diff options
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r-- | gcc/fortran/io.c | 33 |
1 files changed, 26 insertions, 7 deletions
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 (); |