summaryrefslogtreecommitdiff
path: root/gcc/fortran/io.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-01 00:29:54 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-01 00:29:54 +0000
commit6f521718e827a5e9d13418f6226bfe42f26648bb (patch)
treefad3fc076df76ea6f97827a7d37d80fc03eb5bbe /gcc/fortran/io.c
parent4a6200d94e5c62b384cf64af60dcbe00bbc716cc (diff)
downloadgcc-6f521718e827a5e9d13418f6226bfe42f26648bb.tar.gz
Always pass 0 or option number to gfc_warning*.
Similar to the issue with fatal_error that I fixed in <https://gcc.gnu.org/ml/gcc-patches/2015-01/msg02690.html>, the overloads of gfc_warning and gfc_warning_now (with and without a first argument for an option number) also break gcc.pot regeneration because xgettext expects the translated string argument to be in a fixed position for a given function name. This patch applies the corresponding fix of always passing a first argument (option number or 0), just like the core diagnostic functions warning and warning_at, and removing the problem overloads without it. Bootstrapped with no regressions on x86_64-unknown-linux-gnu. * error.c (gfc_warning (const char *, ...), gfc_warning_now (const char *, ...)): Remove functions. * gfortran.h (gfc_warning (const char *, ...), gfc_warning_now (const char *, ...)): Remove declarations. * arith.c, check.c, data.c, decl.c, frontend-passes.c, interface.c, intrinsic.c, io.c, matchexp.c, module.c, openmp.c, options.c, parse.c, primary.c, resolve.c, scanner.c, symbol.c, trans-common.c, trans-const.c, trans-stmt.c: All callers of gfc_warning and gfc_warning_now changed to pass 0 or option number as first argument. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220313 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r--gcc/fortran/io.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index a13d1aed044..7ba6b092e98 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -165,7 +165,7 @@ next_char (gfc_instring in_string)
gfc_current_locus = old_locus;
if (!(gfc_option.allow_std & GFC_STD_GNU) && !inhibit_warnings)
- gfc_warning ("Extension: backslash character at %C");
+ gfc_warning (0, "Extension: backslash character at %C");
}
if (mode == MODE_COPY)
@@ -201,7 +201,7 @@ next_char_not_space (bool *error)
if (c == '\t')
{
if (gfc_option.allow_std & GFC_STD_GNU)
- gfc_warning ("Extension: Tab character in format at %C");
+ gfc_warning (0, "Extension: Tab character in format at %C");
else
{
gfc_error ("Extension: Tab character in format at %C");
@@ -681,7 +681,7 @@ format_item_1:
return false;
if (t != FMT_RPAREN || level > 0)
{
- gfc_warning ("$ should be the last specifier in format at %L",
+ gfc_warning (0, "$ should be the last specifier in format at %L",
&format_locus);
goto optional_comma_1;
}
@@ -779,7 +779,7 @@ data_desc:
case WARNING:
if (mode != MODE_FORMAT)
format_locus.nextc += format_string_pos;
- gfc_warning ("Extension: Missing positive width after L "
+ gfc_warning (0, "Extension: Missing positive width after L "
"descriptor at %L", &format_locus);
saved_token = t;
break;
@@ -874,7 +874,7 @@ data_desc:
goto fail;
}
else
- gfc_warning ("Period required in format "
+ gfc_warning (0, "Period required in format "
"specifier %s at %L", token_to_string (t),
&format_locus);
/* If we go to finished, we need to unwind this
@@ -946,7 +946,7 @@ data_desc:
}
if (mode != MODE_FORMAT)
format_locus.nextc += format_string_pos;
- gfc_warning ("Period required in format specifier at %L",
+ gfc_warning (0, "Period required in format specifier at %L",
&format_locus);
saved_token = t;
break;
@@ -968,7 +968,7 @@ data_desc:
{
if (mode != MODE_FORMAT)
format_locus.nextc += format_string_pos;
- gfc_warning ("The H format specifier at %L is"
+ gfc_warning (0, "The H format specifier at %L is"
" a Fortran 95 deleted feature", &format_locus);
}
if (mode == MODE_STRING)
@@ -1173,7 +1173,8 @@ check_format_string (gfc_expr *e, bool is_input)
if (e->value.character.string[i] != ' ')
{
format_locus.nextc += format_length + 1;
- gfc_warning ("Extraneous characters in format at %L", &format_locus);
+ gfc_warning (0,
+ "Extraneous characters in format at %L", &format_locus);
break;
}
return rv;
@@ -1720,7 +1721,7 @@ compare_to_allowed_values (const char *specifier, const char *allowed[],
if (n == WARNING || (warn && n == ERROR))
{
- gfc_warning ("Fortran 2003: %s specifier in %s statement at %C "
+ gfc_warning (0, "Fortran 2003: %s specifier in %s statement at %C "
"has value %qs", specifier, statement,
allowed_f2003[i]);
return 1;
@@ -1747,7 +1748,7 @@ compare_to_allowed_values (const char *specifier, const char *allowed[],
if (n == WARNING || (warn && n == ERROR))
{
- gfc_warning ("Extension: %s specifier in %s statement at %C "
+ gfc_warning (0, "Extension: %s specifier in %s statement at %C "
"has value %qs", specifier, statement,
allowed_gnu[i]);
return 1;
@@ -1768,7 +1769,8 @@ 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 %qs",
+ gfc_warning (0,
+ "%s specifier in %s statement at %C has invalid value %qs",
specifier, statement, s);
free (s);
return 1;
@@ -2047,7 +2049,7 @@ gfc_match_open (void)
#define warn_or_error(...) \
{ \
if (warn) \
- gfc_warning (__VA_ARGS__); \
+ gfc_warning (0, __VA_ARGS__); \
else \
{ \
gfc_error (__VA_ARGS__); \