diff options
author | Bud Davis <bdavis9659@sbcglobal.net> | 2009-08-26 02:18:14 +0000 |
---|---|---|
committer | Bud Davis <bdavis@gcc.gnu.org> | 2009-08-26 02:18:14 +0000 |
commit | 171fc18dd9e9fc5653711067b1c7061238348099 (patch) | |
tree | 9b5b5c5ce3abc8cded9731ade1d75d4ff3392dbc /gcc/fortran/io.c | |
parent | 645bf0489cee84b6ac0c9a471c6e08f5faa7b1c8 (diff) | |
download | gcc-171fc18dd9e9fc5653711067b1c7061238348099.zip gcc-171fc18dd9e9fc5653711067b1c7061238348099.tar.gz gcc-171fc18dd9e9fc5653711067b1c7061238348099.tar.bz2 |
re PR fortran/28039 (Warn when ignoring extra characters in the format specification)
2009-08-22 Bud Davis <bdavis9659@sbcglobal.net>
PR fortran/28093
* io.c: reverted previous patch
From-SVN: r151112
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r-- | gcc/fortran/io.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index a0a4356..56a9e39 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -121,7 +121,6 @@ format_token; static gfc_char_t *format_string; static int format_string_pos; static int format_length, use_last_char; -static int starting_format_length; static char error_element; static locus format_locus; @@ -933,11 +932,20 @@ data_desc: gfc_warning ("The H format specifier at %L is" " a Fortran 95 deleted feature", &format_locus); } - while (repeat >0) - { - next_char (1); - repeat -- ; - } + + if (mode == MODE_STRING) + { + format_string += value; + format_length -= value; + } + else + { + while (repeat >0) + { + next_char (1); + repeat -- ; + } + } break; case FMT_IBOZ: @@ -1096,13 +1104,6 @@ fail: rv = FAILURE; finished: - /* check for extraneous characters at end of valid format string */ - if ( starting_format_length > format_length ) - { - format_locus.nextc += format_length + 1; /* point to the extra */ - gfc_warning ("Extraneous characters in format at %L", &format_locus); - } - return rv; } @@ -1118,7 +1119,7 @@ check_format_string (gfc_expr *e, bool is_input) mode = MODE_STRING; format_string = e->value.character.string; - starting_format_length = e->value.character.length; + /* More elaborate measures are needed to show where a problem is within a format string that has been calculated, but that's probably not worth the effort. */ |