re PR fortran/53985 (-Wno-c-binding-type still prints a warning)

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
This commit is contained in:
Tobias Burnus 2012-07-17 22:07:32 +02:00 committed by Tobias Burnus
parent 947296ca90
commit 7fe3aa0811
8 changed files with 35 additions and 3 deletions

View 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

View 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),

View 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.

View 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

View 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

View File

@ -1,4 +1,5 @@
! { dg-do compile }
! { dg-options "-Wc-binding-type" }
!
! PR fortran/38160
!

View File

@ -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

View File

@ -1,4 +1,5 @@
! { dg-do compile }
! { dg-options "-Wc-binding-type" }
module interop_params
use, intrinsic :: iso_c_binding