aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2012-03-03 17:09:18 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2012-03-03 17:09:18 +0100
commit0e193637243a877226db68773c0735f88e4d9aab (patch)
treef7bb4780535beeba6d8a2220460dda826bff025e /gcc/fortran/decl.c
parent905f067ca0ead2bffc682701b3b10203a5c911c2 (diff)
downloadgcc-0e193637243a877226db68773c0735f88e4d9aab.zip
gcc-0e193637243a877226db68773c0735f88e4d9aab.tar.gz
gcc-0e193637243a877226db68773c0735f88e4d9aab.tar.bz2
lang.opt (Wc-binding-type): New flag.
2012-03-03 Tobias Burnus <burnus@net-b.de> * lang.opt (Wc-binding-type): New flag. * options.c (gfc_init_options, gfc_handle_option): Handle it. * invoke.texi (Wc-binding-type): Document it. * gfortran.h (gfc_option_t): Add warn_c_binding_type. * decl.c (verify_bind_c_sym): Handle -Wc-binding-type. * symbol.c (gfc_set_default_type, verify_bind_c_derived_type): Ditto. 2012-03-03 Tobias Burnus <burnus@net-b.de> * gfortran.dg/bind_c_dts_4.f03: Add dg-options -Wc-binding-type. * gfortran.dg/bind_c_implicit_vars.f03: Ditto. * gfortran.dg/bind_c_usage_8.f03: Ditto. * gfortran.dg/c_kind_tests_2.f03: Ditto. * gfortran.dg/class_30.f90: Remove dg-warning line. * gfortran.dg/bind_c_usage_25.f90: New. From-SVN: r184858
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index bdb8c39..75b8a89 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -3930,7 +3930,7 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
{
tmp_sym = tmp_sym->result;
/* Make sure it wasn't an implicitly typed result. */
- if (tmp_sym->attr.implicit_type)
+ if (tmp_sym->attr.implicit_type && gfc_option.warn_c_binding_type)
{
gfc_warning ("Implicitly declared BIND(C) function '%s' at "
"%L may not be C interoperable", tmp_sym->name,
@@ -3951,7 +3951,7 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
if (gfc_verify_c_interop (&(tmp_sym->ts)) != SUCCESS)
{
/* See if we're dealing with a sym in a common block or not. */
- if (is_in_common == 1)
+ if (is_in_common == 1 && gfc_option.warn_c_binding_type)
{
gfc_warning ("Variable '%s' in common block '%s' at %L "
"may not be a C interoperable "
@@ -3965,7 +3965,7 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
gfc_error ("Type declaration '%s' at %L is not C "
"interoperable but it is BIND(C)",
tmp_sym->name, &(tmp_sym->declared_at));
- else
+ else if (gfc_option.warn_c_binding_type)
gfc_warning ("Variable '%s' at %L "
"may not be a C interoperable "
"kind but it is bind(c)",