diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2019-11-28 18:33:20 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2019-11-28 18:33:20 +0000 |
commit | 68c28e37e494a639dd6f7e7d21c79af7f8b71d17 (patch) | |
tree | 884fa1d2b27e695975cafb49ab647aacd5f22ba5 /libgfortran/io | |
parent | 9c28689a9908c56fffcf7b1acd6dec3fb8a947e2 (diff) | |
download | gcc-68c28e37e494a639dd6f7e7d21c79af7f8b71d17.zip gcc-68c28e37e494a639dd6f7e7d21c79af7f8b71d17.tar.gz gcc-68c28e37e494a639dd6f7e7d21c79af7f8b71d17.tar.bz2 |
re PR libfortran/90374 (Fortran 2018: Support d0.d, e0.d, es0.d, en0.d, g0.d and ew.d e0 edit descriptors for output)
PR fortran/90374
* io.c (check_format): Allow zero width expoenent with e0.
* io/format.c (parse_format_list): Relax format checking to allow
e0 exponent specifier.
* gfortran.dg/fmt_zero_width.f90: Update test.
From-SVN: r278817
Diffstat (limited to 'libgfortran/io')
-rw-r--r-- | libgfortran/io/format.c | 16 | ||||
-rw-r--r-- | libgfortran/io/write_float.def | 2 |
2 files changed, 12 insertions, 6 deletions
diff --git a/libgfortran/io/format.c b/libgfortran/io/format.c index b336208..dd448c8 100644 --- a/libgfortran/io/format.c +++ b/libgfortran/io/format.c @@ -1027,11 +1027,17 @@ parse_format_list (st_parameter_dt *dtp, bool *seen_dd) { t = format_lex (fmt); if (t != FMT_POSINT) - { - fmt->error = "Positive exponent width required in format"; - goto finished; - } - + if (t == FMT_ZERO) + { + notify_std (&dtp->common, GFC_STD_F2018, + "Positive exponent width required"); + } + else + { + fmt->error = "Positive exponent width required in " + "format string at %L"; + goto finished; + } tail->u.real.e = fmt->value; } diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def index daa1667..ce6aec8 100644 --- a/libgfortran/io/write_float.def +++ b/libgfortran/io/write_float.def @@ -482,7 +482,7 @@ build_float_string (st_parameter_dt *dtp, const fnode *f, char *buffer, for (i = abs (e); i >= 10; i /= 10) edigits++; - if (f->u.real.e < 0) + if (f->u.real.e <= 0) { /* Width not specified. Must be no more than 3 digits. */ if (e > 999 || e < -999) |