aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2014-12-03 17:50:06 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2014-12-03 17:50:06 +0000
commit48749dbcc461753861059d1fc48c40d2e0aefaa2 (patch)
treeffa63d8c289a7c4e01689478d728abff9b4c33ab /gcc/fortran/decl.c
parentd6d34aa9133afdee0ca74b354a72cb720f431c1a (diff)
downloadgcc-48749dbcc461753861059d1fc48c40d2e0aefaa2.zip
gcc-48749dbcc461753861059d1fc48c40d2e0aefaa2.tar.gz
gcc-48749dbcc461753861059d1fc48c40d2e0aefaa2.tar.bz2
re PR fortran/44054 (Handle -Werror, -Werror=, -fdiagnostics-show-option, !GCC$ diagnostic (pragmas) and color)
gcc/testsuite/ChangeLog: 2014-12-03 Manuel López-Ibáñez <manu@gcc.gnu.org> PR fortran/44054 * gfortran.dg/warnings_are_errors_1.f90: Update warnings to errors. * gfortran.dg/warnings_are_errors_1.f: Likewise. gcc/fortran/ChangeLog: 2014-12-03 Manuel López-Ibáñez <manu@gcc.gnu.org> PR fortran/44054 * gfortran.h (gfc_warning): Now returns bool. Add overload that accepts opt. (gfc_warning_1): Declare. * error.c (pp_warning_buffer,warningcount_buffered,werrorcount_buffered): New. (gfc_buffer_error): Set pp_warning_buffer.flush_p. (gfc_clear_pp_buffer): New. (gfc_warning_1): Renamed from gfc_warning. (gfc_warning): Add three new overloads. One that takes just a format string and ellipsis, another that takes also a warning option, and another that takes also va_list instead of ellipsis. (gfc_clear_warning): Clear pp_warning_buffer. (gfc_warning_check): Flush pp_warning_buffer and update warning and werror counters. (gfc_diagnostics_init): Init pp_warning_buffer. * Update all gfc_warning calls that do not multiple locations to use %qs and OPT_W*, otherwise use gfc_warning_1. gcc/ChangeLog: 2014-12-03 Manuel López-Ibáñez <manu@gcc.gnu.org> PR fortran/44054 * pretty-print.c (output_buffer::output_buffer): Init flush_p to true. (pp_flush): Flush only if flush_p. (pp_really_flush): New. * pretty-print.h (struct output_buffer): Add flush_p. (pp_really_flush): Declare. From-SVN: r218326
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index f11bcb0..f374b9a 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -1030,8 +1030,9 @@ gfc_verify_c_interop_param (gfc_symbol *sym)
sym->name, &(sym->declared_at),
sym->ns->proc_name->name);
else if (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 "
+ gfc_warning (OPT_Wc_binding_type,
+ "Variable %qs at %L is a dummy argument of the "
+ "BIND(C) procedure %qs but may not be C "
"interoperable",
sym->name, &(sym->declared_at),
sym->ns->proc_name->name);
@@ -3294,8 +3295,8 @@ gfc_match_import (void)
if (gfc_find_symtree (gfc_current_ns->sym_root, name))
{
- gfc_warning ("'%s' is already IMPORTed from host scoping unit "
- "at %C.", name);
+ gfc_warning ("%qs is already IMPORTed from host scoping unit "
+ "at %C", name);
goto next_item;
}
@@ -4031,7 +4032,8 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
/* Make sure it wasn't an implicitly typed result. */
if (tmp_sym->attr.implicit_type && warn_c_binding_type)
{
- gfc_warning ("Implicitly declared BIND(C) function '%s' at "
+ gfc_warning (OPT_Wc_binding_type,
+ "Implicitly declared BIND(C) function %qs at "
"%L may not be C interoperable", tmp_sym->name,
&tmp_sym->declared_at);
tmp_sym->ts.f90_type = tmp_sym->ts.type;
@@ -4052,9 +4054,10 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
/* See if we're dealing with a sym in a common block or not. */
if (is_in_common == 1 && warn_c_binding_type)
{
- gfc_warning ("Variable '%s' in common block '%s' at %L "
+ gfc_warning (OPT_Wc_binding_type,
+ "Variable %qs in common block %qs at %L "
"may not be a C interoperable "
- "kind though common block '%s' is BIND(C)",
+ "kind though common block %qs is BIND(C)",
tmp_sym->name, com_block->name,
&(tmp_sym->declared_at), com_block->name);
}
@@ -4065,7 +4068,7 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
"interoperable but it is BIND(C)",
tmp_sym->name, &(tmp_sym->declared_at));
else if (warn_c_binding_type)
- gfc_warning ("Variable '%s' at %L "
+ gfc_warning (OPT_Wc_binding_type, "Variable %qs at %L "
"may not be a C interoperable "
"kind but it is bind(c)",
tmp_sym->name, &(tmp_sym->declared_at));