aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/decl.c4
-rw-r--r--gcc/testsuite/ChangeLog9
-rw-r--r--gcc/testsuite/gfortran.dg/bind_c_procs.f031
-rw-r--r--gcc/testsuite/gfortran.dg/bind_c_usage_13.f032
-rw-r--r--gcc/testsuite/gfortran.dg/bind_c_usage_18.f901
-rw-r--r--gcc/testsuite/gfortran.dg/bind_c_usage_26.f9014
-rw-r--r--gcc/testsuite/gfortran.dg/interop_params.f031
8 files changed, 35 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 9042014..dd7958b 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,5 +1,11 @@
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.
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 89d501c..83a4c60 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -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),
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d3bfd48..70efda9 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/gfortran.dg/bind_c_procs.f03 b/gcc/testsuite/gfortran.dg/bind_c_procs.f03
index eaf0672..3bb6ea3 100644
--- a/gcc/testsuite/gfortran.dg/bind_c_procs.f03
+++ b/gcc/testsuite/gfortran.dg/bind_c_procs.f03
@@ -1,4 +1,5 @@
! { dg-do compile }
+! { dg-options "-Wc-binding-type" }
module bind_c_procs
use, intrinsic :: iso_c_binding, only: c_int
diff --git a/gcc/testsuite/gfortran.dg/bind_c_usage_13.f03 b/gcc/testsuite/gfortran.dg/bind_c_usage_13.f03
index d89963d..b8c2261 100644
--- a/gcc/testsuite/gfortran.dg/bind_c_usage_13.f03
+++ b/gcc/testsuite/gfortran.dg/bind_c_usage_13.f03
@@ -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
diff --git a/gcc/testsuite/gfortran.dg/bind_c_usage_18.f90 b/gcc/testsuite/gfortran.dg/bind_c_usage_18.f90
index 2bce215..ede9f60 100644
--- a/gcc/testsuite/gfortran.dg/bind_c_usage_18.f90
+++ b/gcc/testsuite/gfortran.dg/bind_c_usage_18.f90
@@ -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
index 0000000..20a68d1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/bind_c_usage_26.f90
@@ -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
diff --git a/gcc/testsuite/gfortran.dg/interop_params.f03 b/gcc/testsuite/gfortran.dg/interop_params.f03
index ea3dada..6eafba0 100644
--- a/gcc/testsuite/gfortran.dg/interop_params.f03
+++ b/gcc/testsuite/gfortran.dg/interop_params.f03
@@ -1,4 +1,5 @@
! { dg-do compile }
+! { dg-options "-Wc-binding-type" }
module interop_params
use, intrinsic :: iso_c_binding