]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/53985 (-Wno-c-binding-type still prints a warning)
authorTobias Burnus <burnus@net-b.de>
Tue, 17 Jul 2012 20:07:32 +0000 (22:07 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Tue, 17 Jul 2012 20:07:32 +0000 (22:07 +0200)
2012-07-17  Tobias Burnus  <burnus@net-b.de>

        PR fortran/53985
        * decl.c (gfc_verify_c_interop_param): Make warning conditional
        on -Wc-binding-type works and improve the wording.

2012-07-17  Tobias Burnus  <burnus@net-b.de>

        PR fortran/53985
        * gfortran.dg/bind_c_usage_26.f90: New.
        * gfortran.dg/bind_c_procs.f03: Add dg-options
        * "-Wc-binding-type".
        * gfortran.dg/bind_c_usage_13.f03: Ditto.
        * gfortran.dg/bind_c_usage_18.f90: Ditto.
        * gfortran.dg/interop_params.f03: Ditto.

From-SVN: r189586

gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/bind_c_procs.f03
gcc/testsuite/gfortran.dg/bind_c_usage_13.f03
gcc/testsuite/gfortran.dg/bind_c_usage_18.f90
gcc/testsuite/gfortran.dg/bind_c_usage_26.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/interop_params.f03

index 9042014780296a1fb005101a4c1e99326bd439c8..dd7958bec8127baf78552ce1dc7e7373fa2984f3 100644 (file)
@@ -1,3 +1,9 @@
+2012-07-17  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/53985
+       * decl.c (gfc_verify_c_interop_param): Make warning conditional
+       on -Wc-binding-type works and improve the wording.
+
 2012-07-17  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/52101
index 89d501cdc1832796ea0e56c0d48276f1bfe43102..83a4c602f1dccf30d22b914756207bebf26e9bc2 100644 (file)
@@ -1028,8 +1028,8 @@ gfc_verify_c_interop_param (gfc_symbol *sym)
                           "because it is polymorphic",
                           sym->name, &(sym->declared_at),
                           sym->ns->proc_name->name);
-             else
-               gfc_warning ("Variable '%s' at %L is a parameter to the "
+             else if (gfc_option.warn_c_binding_type)
+               gfc_warning ("Variable '%s' at %L is a dummy argument of the "
                             "BIND(C) procedure '%s' but may not be C "
                             "interoperable",
                             sym->name, &(sym->declared_at),
index d3bfd48b7212d157b64257693c3ccebe12364a7b..70efda9ed5dda0f332e10f97d4f47a2295b70cea 100644 (file)
@@ -1,3 +1,12 @@
+2012-07-17  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/53985
+       * gfortran.dg/bind_c_usage_26.f90: New.
+       * gfortran.dg/bind_c_procs.f03: Add dg-options "-Wc-binding-type".
+       * gfortran.dg/bind_c_usage_13.f03: Ditto.
+       * gfortran.dg/bind_c_usage_18.f90: Ditto.
+       * gfortran.dg/interop_params.f03: Ditto.
+
 2012-07-17  Jason Merrill  <jason@redhat.com>
 
        * g++.dg/template/inherit8.C: Adjust.
index eaf067289d8effa1b06539b1ecdc9e726a358584..3bb6ea319c92c73237ee02bb2c6b0c6d7248f644 100644 (file)
@@ -1,4 +1,5 @@
 ! { dg-do compile }
+! { dg-options "-Wc-binding-type" }
 module bind_c_procs
   use, intrinsic :: iso_c_binding, only: c_int
 
index d89963d8b1dc2e870545180ff2cf6cb844105bde..b8c226186692869a13a0931394427b055b98faab 100644 (file)
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-! { dg-options "-fdump-tree-original" }
+! { dg-options "-fdump-tree-original -Wc-binding-type" }
 !
 ! PR fortran/34079
 ! Character bind(c) arguments shall not pass the length as additional argument
index 2bce215af1946d7772ab4a11b49caccb18bcfc1c..ede9f60e83fb72cbd1e903c120ff97ef669bc4ea 100644 (file)
@@ -1,4 +1,5 @@
 ! { dg-do compile }
+! { dg-options "-Wc-binding-type" }
 !
 ! PR fortran/38160
 !
diff --git a/gcc/testsuite/gfortran.dg/bind_c_usage_26.f90 b/gcc/testsuite/gfortran.dg/bind_c_usage_26.f90
new file mode 100644 (file)
index 0000000..20a68d1
--- /dev/null
@@ -0,0 +1,14 @@
+! { dg-do compile }
+!
+! PR fortran/53985
+!
+! Check that the (default) -Wno-c-binding-type works
+! and no warning is printed.
+!
+! With -Wc-binding-type, one gets:
+!  Warning: Variable 'x' at (1) is a dummy argument to the BIND(C) procedure
+!           'test' but may not be C interoperable )
+!
+subroutine test(x) bind(C)
+  integer :: x
+end subroutine test
index ea3dadac040ac998b9d4cb6400aa5c15722b005e..6eafba0ea6933ded132fcd0541c86d450e35bae8 100644 (file)
@@ -1,4 +1,5 @@
 ! { dg-do compile }
+! { dg-options "-Wc-binding-type" }
 module interop_params
 use, intrinsic :: iso_c_binding