diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2014-12-03 17:50:06 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2014-12-03 17:50:06 +0000 |
commit | 48749dbcc461753861059d1fc48c40d2e0aefaa2 (patch) | |
tree | ffa63d8c289a7c4e01689478d728abff9b4c33ab /gcc/fortran/interface.c | |
parent | d6d34aa9133afdee0ca74b354a72cb720f431c1a (diff) | |
download | gcc-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/interface.c')
-rw-r--r-- | gcc/fortran/interface.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 2429fd2..bf07d43 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -1178,7 +1178,7 @@ check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2, case -2: /* FIXME: Implement a warning for this case. - gfc_warning ("Possible character length mismatch in argument '%s'", + gfc_warning ("Possible character length mismatch in argument %qs", s1->name);*/ break; @@ -1649,11 +1649,11 @@ check_interface1 (gfc_interface *p, gfc_interface *q0, p->sym->name, q->sym->name, interface_name, &p->where); else if (!p->sym->attr.use_assoc && q->sym->attr.use_assoc) - gfc_warning ("Ambiguous interfaces '%s' and '%s' in %s at %L", + gfc_warning ("Ambiguous interfaces %qs and %qs in %s at %L", p->sym->name, q->sym->name, interface_name, &p->where); else - gfc_warning ("Although not referenced, '%s' has ambiguous " + gfc_warning ("Although not referenced, %qs has ambiguous " "interfaces at %L", interface_name, &p->where); return 1; } @@ -2147,8 +2147,9 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual, return 0; } else if (warn_surprising && where && formal->attr.intent != INTENT_IN) - gfc_warning ("Passing coarray at %L to allocatable, noncoarray dummy " - "argument '%s', which is invalid if the allocation status" + gfc_warning (OPT_Wsurprising, + "Passing coarray at %L to allocatable, noncoarray dummy " + "argument %qs, which is invalid if the allocation status" " is modified", &actual->where, formal->name); } @@ -2673,13 +2674,13 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal, if (where && (f->sym->attr.pointer || f->sym->attr.allocatable)) gfc_warning ("Character length mismatch (%ld/%ld) between actual " "argument and pointer or allocatable dummy argument " - "'%s' at %L", + "%qs at %L", mpz_get_si (a->expr->ts.u.cl->length->value.integer), mpz_get_si (f->sym->ts.u.cl->length->value.integer), f->sym->name, &a->expr->where); else if (where) gfc_warning ("Character length mismatch (%ld/%ld) between actual " - "argument and assumed-shape dummy argument '%s' " + "argument and assumed-shape dummy argument %qs " "at %L", mpz_get_si (a->expr->ts.u.cl->length->value.integer), mpz_get_si (f->sym->ts.u.cl->length->value.integer), @@ -2710,12 +2711,12 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal, { if (a->expr->ts.type == BT_CHARACTER && !f->sym->as && where) gfc_warning ("Character length of actual argument shorter " - "than of dummy argument '%s' (%lu/%lu) at %L", + "than of dummy argument %qs (%lu/%lu) at %L", f->sym->name, actual_size, formal_size, &a->expr->where); else if (where) gfc_warning ("Actual argument contains too few " - "elements for dummy argument '%s' (%lu/%lu) at %L", + "elements for dummy argument %qs (%lu/%lu) at %L", f->sym->name, actual_size, formal_size, &a->expr->where); return 0; @@ -3146,7 +3147,7 @@ check_some_aliasing (gfc_formal_arglist *f, gfc_actual_arglist *a) || (f1_intent == INTENT_OUT && f2_intent == INTENT_OUT)) { gfc_warning ("Same actual argument associated with INTENT(%s) " - "argument '%s' and INTENT(%s) argument '%s' at %L", + "argument %qs and INTENT(%s) argument %qs at %L", gfc_intent_string (f1_intent), p[i].f->sym->name, gfc_intent_string (f2_intent), p[j].f->sym->name, &p[i].a->expr->where); @@ -3261,10 +3262,12 @@ gfc_procedure_use (gfc_symbol *sym, gfc_actual_arglist **ap, locus *where) return false; } if (warn_implicit_interface) - gfc_warning ("Procedure '%s' called with an implicit interface at %L", + gfc_warning (OPT_Wimplicit_interface, + "Procedure %qs called with an implicit interface at %L", sym->name, where); else if (warn_implicit_procedure && sym->attr.proc == PROC_UNKNOWN) - gfc_warning ("Procedure '%s' called at %L is not explicitly declared", + gfc_warning (OPT_Wimplicit_procedure, + "Procedure %qs called at %L is not explicitly declared", sym->name, where); } @@ -3376,7 +3379,8 @@ gfc_ppc_use (gfc_component *comp, gfc_actual_arglist **ap, locus *where) if (warn_implicit_interface && comp->attr.if_source == IFSRC_UNKNOWN && !comp->attr.is_iso_c) - gfc_warning ("Procedure pointer component '%s' called with an implicit " + gfc_warning (OPT_Wimplicit_interface, + "Procedure pointer component %qs called with an implicit " "interface at %L", comp->name, where); if (comp->attr.if_source == IFSRC_UNKNOWN) |