diff options
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/io.c | 33 |
2 files changed, 33 insertions, 7 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f9f9da2..5023949 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2019-11-06 Jerry DeLisle <jvdelisle@gcc.ngu.org> + + PR fortran/90374 + * io.c (check_format): Allow zero width for D, E, EN, and ES + specifiers as default and when -std=F2018 is given. Retain + existing errors when using the -fdec family of flags. + 2019-11-03 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/92113 diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index b969a1a..57a3fdd 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -922,19 +922,38 @@ data_desc: if (u != FMT_POSINT) { + if (flag_dec) + { + if (flag_dec_format_defaults) + { + /* Assume a default width based on the variable size. */ + saved_token = u; + break; + } + else + { + gfc_error ("Positive width required in format " + "specifier %s at %L", token_to_string (t), + &format_locus); + saved_token = u; + goto fail; + } + } + + format_locus.nextc += format_string_pos; + if (!gfc_notify_std (GFC_STD_F2018, + "positive width required at %L", + &format_locus)) + { + saved_token = u; + goto fail; + } if (flag_dec_format_defaults) { /* Assume a default width based on the variable size. */ saved_token = u; break; } - - format_locus.nextc += format_string_pos; - gfc_error ("Positive width required in format " - "specifier %s at %L", token_to_string (t), - &format_locus); - saved_token = u; - goto fail; } u = format_lex (); |