aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/io.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2014-12-13 00:12:06 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2014-12-13 00:12:06 +0100
commita4d9b2212cbf2912387c215da744c217de80f5d2 (patch)
tree142ed494ce58fe546f97386fe9da7a4610d92270 /gcc/fortran/io.c
parent33948765f16435febf518b9ce4843b4b1e386677 (diff)
downloadgcc-a4d9b2212cbf2912387c215da744c217de80f5d2.zip
gcc-a4d9b2212cbf2912387c215da744c217de80f5d2.tar.gz
gcc-a4d9b2212cbf2912387c215da744c217de80f5d2.tar.bz2
error.c (gfc_error): Add variant which takes a va_list.
2014-12-13 Tobias Burnus <burnus@net-b.de> Manuel López-Ibáñez <manu@gcc.gnu.org> fortran/ * error.c (gfc_error): Add variant which takes a va_list. (gfc_notify_std): Convert to common diagnostic. * array.c: Use %qs, %<...%> in more gfc_error calls and for gfc_notify_std. * check.c: Ditto. * data.c: Ditto. * decl.c: Ditto. * expr.c: Ditto. * interface.c: Ditto. * intrinsic.c: Ditto. * io.c: Ditto. * match.c: Ditto. * matchexp.c: Ditto. * module.c: Ditto. * openmp.c: Ditto. * parse.c: Ditto. * primary.c: Ditto. * resolve.c: Ditto. * simplify.c: Ditto. * symbol.c: Ditto. * trans-common.c: Ditto. * trans-intrinsic.c: Ditto. gcc/testsuite/ * gfortran.dg/realloc_on_assign_21.f90: Update dg-error. * gfortran.dg/warnings_are_errors_1.f: Ditto. * gfortran.dg/warnings_are_errors_1.f90: Ditto. Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org> From-SVN: r218694
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r--gcc/fortran/io.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index de8254a..ef0e59a 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -550,8 +550,8 @@ 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 string"
- " at %L");
+ const char *unexpected_element = _("Unexpected element %<%c%> in format "
+ "string at %L");
const char *unexpected_end = _("Unexpected end of format string");
const char *zero_width = _("Zero width in format descriptor");
@@ -602,7 +602,7 @@ format_item_1:
level++;
goto format_item;
}
- error = _("Left parenthesis required after '*'");
+ error = _("Left parenthesis required after %<*%>");
goto syntax;
case FMT_POSINT:
@@ -823,7 +823,7 @@ data_desc:
error = zero_width;
goto syntax;
}
- if (!gfc_notify_std (GFC_STD_F2008, "'G0' in format at %L",
+ if (!gfc_notify_std (GFC_STD_F2008, "%<G0%> in format at %L",
&format_locus))
return false;
u = format_lex ();
@@ -1408,14 +1408,14 @@ resolve_tag_format (const gfc_expr *e)
return false;
if (e->symtree->n.sym->attr.assign != 1)
{
- gfc_error ("Variable '%s' at %L has not been assigned a "
+ gfc_error ("Variable %qs at %L has not been assigned a "
"format label", e->symtree->n.sym->name, &e->where);
return false;
}
}
else if (e->ts.type == BT_INTEGER)
{
- gfc_error ("Scalar '%s' in FORMAT tag at %L is not an ASSIGNED "
+ gfc_error ("Scalar %qs in FORMAT tag at %L is not an ASSIGNED "
"variable", gfc_basic_typename (e->ts.type), &e->where);
return false;
}
@@ -1729,7 +1729,7 @@ compare_to_allowed_values (const char *specifier, const char *allowed[],
if (n == ERROR)
{
gfc_notify_std (GFC_STD_F2003, "%s specifier in "
- "%s statement at %C has value '%s'", specifier,
+ "%s statement at %C has value %qs", specifier,
statement, allowed_f2003[i]);
return 0;
}
@@ -1756,7 +1756,7 @@ compare_to_allowed_values (const char *specifier, const char *allowed[],
if (n == ERROR)
{
gfc_notify_std (GFC_STD_GNU, "%s specifier in "
- "%s statement at %C has value '%s'", specifier,
+ "%s statement at %C has value %qs", specifier,
statement, allowed_gnu[i]);
return 0;
}
@@ -1768,7 +1768,7 @@ compare_to_allowed_values (const char *specifier, const char *allowed[],
if (warn)
{
char *s = gfc_widechar_to_char (value, -1);
- gfc_warning ("%s specifier in %s statement at %C has invalid value '%s'",
+ gfc_warning ("%s specifier in %s statement at %C has invalid value %qs",
specifier, statement, s);
free (s);
return 1;
@@ -1776,7 +1776,7 @@ compare_to_allowed_values (const char *specifier, const char *allowed[],
else
{
char *s = gfc_widechar_to_char (value, -1);
- gfc_error ("%s specifier in %s statement at %C has invalid value '%s'",
+ gfc_error ("%s specifier in %s statement at %C has invalid value %qs",
specifier, statement, s);
free (s);
return 0;
@@ -2085,7 +2085,7 @@ gfc_match_open (void)
char *s = gfc_widechar_to_char (open->status->value.character.string,
-1);
warn_or_error ("The STATUS specified in OPEN statement at %C is "
- "'%s' and no FILE specifier is present", s);
+ "%qs and no FILE specifier is present", s);
free (s);
}
@@ -2618,7 +2618,7 @@ check_namelist (gfc_symbol *sym)
for (p = sym->namelist; p; p = p->next)
if (p->sym->attr.intent == INTENT_IN)
{
- gfc_error ("Symbol '%s' in namelist '%s' is INTENT(IN) at %C",
+ gfc_error ("Symbol %qs in namelist %qs is INTENT(IN) at %C",
p->sym->name, sym->name);
return 1;
}
@@ -2663,7 +2663,7 @@ match_dt_element (io_kind k, gfc_dt *dt)
if (sym == NULL || sym->attr.flavor != FL_NAMELIST)
{
- gfc_error ("Symbol '%s' at %C must be a NAMELIST group name",
+ gfc_error ("Symbol %qs at %C must be a NAMELIST group name",
sym != NULL ? sym->name : name);
return MATCH_ERROR;
}
@@ -2892,8 +2892,8 @@ gfc_resolve_dt (gfc_dt *dt, locus *loc)
if (!t)
{
- gfc_error ("NAMELIST '%s' in READ statement at %L contains"
- " the symbol '%s' which may not appear in a"
+ gfc_error ("NAMELIST %qs in READ statement at %L contains"
+ " the symbol %qs which may not appear in a"
" variable definition context",
dt->namelist->name, loc, n->sym->name);
return false;
@@ -3533,11 +3533,11 @@ if (condition) \
"YES or NO.", &expr->where);
io_constraint (dt->size && not_no && k == M_READ,
- "SIZE tag at %L requires an ADVANCE = 'NO'",
+ "SIZE tag at %L requires an ADVANCE = %<NO%>",
&dt->size->where);
io_constraint (dt->eor && not_no && k == M_READ,
- "EOR tag at %L requires an ADVANCE = 'NO'",
+ "EOR tag at %L requires an ADVANCE = %<NO%>",
&dt->eor_where);
}