From 811582ec147f4eb722b75578faba4a94c5cfd829 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Wed, 9 Dec 2015 20:29:46 +0100 Subject: [PATCH] re PR fortran/68815 (Error/warning diagnostic: '%s' should be converted to %qs-like or %<%s%>-like string strings) 2015-12-09 Tobias Burnus PR fortran/68815 * decl.c (gfc_verify_c_interop_param, variable_decl): Use %< ... %> for quoting in diagnostics. * io.c (check_format): Ditto. * resolve.c (resolve_operator): Ditto. * symbol.c (check_conflict): Ditto. * trans-common.c (translate_common): Ditto. From-SVN: r231472 --- gcc/fortran/ChangeLog | 10 ++++++++++ gcc/fortran/decl.c | 6 +++--- gcc/fortran/io.c | 2 +- gcc/fortran/resolve.c | 15 ++++++++------- gcc/fortran/symbol.c | 2 +- gcc/fortran/trans-common.c | 2 +- 6 files changed, 24 insertions(+), 13 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 8e74bec4086..53c0bda672d 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,13 @@ +2015-12-09 Tobias Burnus + + PR fortran/68815 + * decl.c (gfc_verify_c_interop_param, variable_decl): Use + %< ... %> for quoting in diagnostics. + * io.c (check_format): Ditto. + * resolve.c (resolve_operator): Ditto. + * symbol.c (check_conflict): Ditto. + * trans-common.c (translate_common): Ditto. + 2015-12-07 David Malcolm * error.c (gfc_format_decoder): Update for change of diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index bff23e1f207..b03dadf6e72 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -1194,7 +1194,7 @@ gfc_verify_c_interop_param (gfc_symbol *sym) if (sym->as != NULL && sym->as->type == AS_ASSUMED_SHAPE && !gfc_notify_std (GFC_STD_F2008_TS, "Assumed-shape array %qs " "at %L as dummy argument to the BIND(C) " - "procedure '%s' at %L", sym->name, + "procedure %qs at %L", sym->name, &(sym->declared_at), sym->ns->proc_name->name, &(sym->ns->proc_name->declared_at))) @@ -2023,9 +2023,9 @@ variable_decl (int elem) if (sym != NULL && (sym->attr.dummy || sym->attr.result)) { m = MATCH_ERROR; - gfc_error ("'%s' at %C is a redefinition of the declaration " + gfc_error ("%qs at %C is a redefinition of the declaration " "in the corresponding interface for MODULE " - "PROCEDURE '%s'", sym->name, + "PROCEDURE %qs", sym->name, gfc_current_ns->proc_name->name); goto cleanup; } diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index 8cf952f95a8..9a772346686 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -549,7 +549,7 @@ check_format (bool is_input) { const char *posint_required = _("Positive width required"); const char *nonneg_required = _("Nonnegative width required"); - const char *unexpected_element = _("Unexpected element %<%c%> in format " + const char *unexpected_element = _("Unexpected element %qc in format " "string at %L"); const char *unexpected_end = _("Unexpected end of format string"); const char *zero_width = _("Zero width in format descriptor"); diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 10add62a839..65a2b7f3f34 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -3560,7 +3560,7 @@ resolve_operator (gfc_expr *e) break; } - sprintf (msg, _("Operand of unary numeric operator '%s' at %%L is %s"), + sprintf (msg, _("Operand of unary numeric operator %%<%s%%> at %%L is %s"), gfc_op2string (e->value.op.op), gfc_typename (&e->ts)); goto bad_op; @@ -3576,7 +3576,7 @@ resolve_operator (gfc_expr *e) } sprintf (msg, - _("Operands of binary numeric operator '%s' at %%L are %s/%s"), + _("Operands of binary numeric operator %%<%s%%> at %%L are %s/%s"), gfc_op2string (e->value.op.op), gfc_typename (&op1->ts), gfc_typename (&op2->ts)); goto bad_op; @@ -3610,7 +3610,7 @@ resolve_operator (gfc_expr *e) break; } - sprintf (msg, _("Operands of logical operator '%s' at %%L are %s/%s"), + sprintf (msg, _("Operands of logical operator %%<%s%%> at %%L are %s/%s"), gfc_op2string (e->value.op.op), gfc_typename (&op1->ts), gfc_typename (&op2->ts)); @@ -3695,7 +3695,7 @@ resolve_operator (gfc_expr *e) ? ".eqv." : ".neqv.", gfc_op2string (e->value.op.op)); else sprintf (msg, - _("Operands of comparison operator '%s' at %%L are %s/%s"), + _("Operands of comparison operator %%<%s%%> at %%L are %s/%s"), gfc_op2string (e->value.op.op), gfc_typename (&op1->ts), gfc_typename (&op2->ts)); @@ -3703,13 +3703,14 @@ resolve_operator (gfc_expr *e) case INTRINSIC_USER: if (e->value.op.uop->op == NULL) - sprintf (msg, _("Unknown operator '%s' at %%L"), e->value.op.uop->name); + sprintf (msg, _("Unknown operator %%<%s%%> at %%L"), + e->value.op.uop->name); else if (op2 == NULL) - sprintf (msg, _("Operand of user operator '%s' at %%L is %s"), + sprintf (msg, _("Operand of user operator %%<%s%%> at %%L is %s"), e->value.op.uop->name, gfc_typename (&op1->ts)); else { - sprintf (msg, _("Operands of user operator '%s' at %%L are %s/%s"), + sprintf (msg, _("Operands of user operator %%<%s%%> at %%L are %s/%s"), e->value.op.uop->name, gfc_typename (&op1->ts), gfc_typename (&op2->ts)); e->value.op.uop->op->sym->attr.referenced = 1; diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index ff9aff93a14..311f743f8ff 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -465,7 +465,7 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where) if (attr->dummy && ((attr->function || attr->subroutine) && gfc_current_state () == COMP_CONTAINS)) - gfc_error_now ("internal procedure '%s' at %L conflicts with " + gfc_error_now ("internal procedure %qs at %L conflicts with " "DUMMY argument", name, where); conf (dummy, entry); diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index af9fadf4690..bbbc7267517 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -1166,7 +1166,7 @@ translate_common (gfc_common_head *common, gfc_symbol *var_list) if (common_segment == NULL) { - gfc_error ("COMMON '%s' at %L does not exist", + gfc_error ("COMMON %qs at %L does not exist", common->name, &common->where); return; } -- 2.30.2