diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2016-11-17 00:18:18 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2016-11-17 00:18:18 +0000 |
commit | 99c72130970cb106f4791b2dff7cda1ac3cfea31 (patch) | |
tree | 9649680187c334e798f76d404930176731428bf3 /gcc/fortran/io.c | |
parent | 243255c0983c8c1e9ea79a0296fd41a13c052b27 (diff) | |
download | gcc-99c72130970cb106f4791b2dff7cda1ac3cfea31.zip gcc-99c72130970cb106f4791b2dff7cda1ac3cfea31.tar.gz gcc-99c72130970cb106f4791b2dff7cda1ac3cfea31.tar.bz2 |
re PR fortran/58001 (Make it possible to silence "Extension: Tab character in format" warning)
2016-11-16 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/58001
* io.c (next_char_not_space): Update handling of a 'tab' in a FORMAT.
(format_lex): Adjust invocations of next_char_not_space().
2016-11-16 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/58001
* gfortran.dg/fmt_tab_1.f90: Adjust testcase.
* gfortran.dg/fmt_tab_2.f90: Ditto.
From-SVN: r242530
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r-- | gcc/fortran/io.c | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index 04cc1a2..d35437a 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -200,23 +200,14 @@ unget_char (void) /* Eat up the spaces and return a character. */ static char -next_char_not_space (bool *error) +next_char_not_space () { char c; do { error_element = c = next_char (NONSTRING); if (c == '\t') - { - if (gfc_option.allow_std & GFC_STD_GNU) - gfc_warning (0, "Extension: Tab character in format at %C"); - else - { - gfc_error ("Extension: Tab character in format at %C"); - *error = true; - return c; - } - } + gfc_warning (OPT_Wtabs, "Nonconforming tab character in format at %C"); } while (gfc_is_whitespace (c)); return c; @@ -234,7 +225,6 @@ format_lex (void) char c, delim; int zflag; int negative_flag; - bool error = false; if (saved_token != FMT_NONE) { @@ -243,7 +233,7 @@ format_lex (void) return token; } - c = next_char_not_space (&error); + c = next_char_not_space (); negative_flag = 0; switch (c) @@ -253,7 +243,7 @@ format_lex (void) /* Falls through. */ case '+': - c = next_char_not_space (&error); + c = next_char_not_space (); if (!ISDIGIT (c)) { token = FMT_UNKNOWN; @@ -264,7 +254,7 @@ format_lex (void) do { - c = next_char_not_space (&error); + c = next_char_not_space (); if (ISDIGIT (c)) value = 10 * value + c - '0'; } @@ -294,7 +284,7 @@ format_lex (void) do { - c = next_char_not_space (&error); + c = next_char_not_space (); if (ISDIGIT (c)) { value = 10 * value + c - '0'; @@ -329,7 +319,7 @@ format_lex (void) break; case 'T': - c = next_char_not_space (&error); + c = next_char_not_space (); switch (c) { case 'L': @@ -357,7 +347,7 @@ format_lex (void) break; case 'S': - c = next_char_not_space (&error); + c = next_char_not_space (); if (c != 'P' && c != 'S') unget_char (); @@ -365,7 +355,7 @@ format_lex (void) break; case 'B': - c = next_char_not_space (&error); + c = next_char_not_space (); if (c == 'N' || c == 'Z') token = FMT_BLANK; else @@ -427,7 +417,7 @@ format_lex (void) break; case 'E': - c = next_char_not_space (&error); + c = next_char_not_space (); if (c == 'N' ) token = FMT_EN; else if (c == 'S') @@ -457,7 +447,7 @@ format_lex (void) break; case 'D': - c = next_char_not_space (&error); + c = next_char_not_space (); if (c == 'P') { if (!gfc_notify_std (GFC_STD_F2003, "DP format " @@ -478,7 +468,7 @@ format_lex (void) "specifier not allowed at %C")) return FMT_ERROR; token = FMT_DT; - c = next_char_not_space (&error); + c = next_char_not_space (); if (c == '\'' || c == '"') { delim = c; @@ -518,7 +508,7 @@ format_lex (void) break; case 'R': - c = next_char_not_space (&error); + c = next_char_not_space (); switch (c) { case 'C': @@ -559,9 +549,6 @@ format_lex (void) break; } - if (error) - return FMT_ERROR; - return token; } |