diff options
author | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-10-31 19:59:04 +0000 |
---|---|---|
committer | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-10-31 19:59:04 +0000 |
commit | a5b29676730945e1314887bebb5517a165ddc105 (patch) | |
tree | 292ac1fe7c5478186685607a63e690054cfb4986 /libgfortran | |
parent | e5336da83ea8d6372b1d036bddb807da50cb964f (diff) |
2016-10-31 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/54679
* io.c (check_format): Adjust checks for FMT_L to treat a zero
width as an extension, giving warnings or error as appropriate.
Improve messages.
PR libgfortran/54679
* io/format.c (parse_format_list): Adjust checks for FMT_L to
treat a zero width as an extension, giving warnings or error
as appropriate. Improve messages.
PR fortran/54679
* gfortran.dg/fmt_l.f90: Update test.
* gfortran.dg/fmt_l0.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241720 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 7 | ||||
-rw-r--r-- | libgfortran/io/format.c | 18 |
2 files changed, 19 insertions, 6 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 78d3949240b..745adf798d2 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,10 @@ +2016-10-31 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libgfortran/54679 + * io/format.c (parse_format_list): Adjust checks for FMT_L to + treat a zero width as an extension, giving warnings or error + as appropriate. Improve messages. + 2016-10-30 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/78123 diff --git a/libgfortran/io/format.c b/libgfortran/io/format.c index 31bc642910a..8a1859749e1 100644 --- a/libgfortran/io/format.c +++ b/libgfortran/io/format.c @@ -870,19 +870,25 @@ parse_format_list (st_parameter_dt *dtp, bool *seen_dd) t = format_lex (fmt); if (t != FMT_POSINT) { - if (notification_std(GFC_STD_GNU) == NOTIFICATION_ERROR) + if (t == FMT_ZERO) { - fmt->error = posint_required; - goto finished; + if (notification_std(GFC_STD_GNU) == NOTIFICATION_ERROR) + { + fmt->error = "Extension: Zero width after L descriptor"; + goto finished; + } + else + notify_std (&dtp->common, GFC_STD_GNU, + "Zero width after L descriptor"); } else { fmt->saved_token = t; - fmt->value = 1; /* Default width */ - notify_std (&dtp->common, GFC_STD_GNU, posint_required); + notify_std (&dtp->common, GFC_STD_GNU, + "Positive width required with L descriptor"); } + fmt->value = 1; /* Default width */ } - get_fnode (fmt, &head, &tail, FMT_L); tail->u.n = fmt->value; tail->repeat = repeat; |