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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189586
138bc75d-0d04-0410-961f-
82ee72b054a4
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
* decl.c (match_char_length): Extra argument, show obsolenscent
warning only if *length is used after the typename.
"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),
+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.
! { dg-do compile }
+! { dg-options "-Wc-binding-type" }
module bind_c_procs
use, intrinsic :: iso_c_binding, only: c_int
! { 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
! { dg-do compile }
+! { dg-options "-Wc-binding-type" }
!
! PR fortran/38160
!
--- /dev/null
+! { 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
! { dg-do compile }
+! { dg-options "-Wc-binding-type" }
module interop_params
use, intrinsic :: iso_c_binding