From: Francois-Xavier Coudert Date: Sat, 18 Nov 2006 12:16:42 +0000 (+0100) Subject: re PR fortran/24285 ([4.2 only] format(1000(a,$))) X-Git-Tag: releases/gcc-4.3.0~8405 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b66643229dfc1d2a19bd163654ae277de55a1fa;p=thirdparty%2Fgcc.git re PR fortran/24285 ([4.2 only] format(1000(a,$))) PR fortran/24285 * io.c (check_format): Allow dollars everywhere in format, and issue a warning. * gfortran.dg/dollar_edit_descriptor-3.f: New test. From-SVN: r118971 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 281539573bb0..dc4cab9aa5fc 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2006-11-18 Francois-Xavier Coudert + + PR fortran/24285 + * io.c (check_format): Allow dollars everywhere in format, and + issue a warning. + 2006-11-17 Francois-Xavier Coudert * gfortran.h (gfc_add_intrinsic_modules_path, diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index 24a92090f9e4..adf274ee1189 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -510,8 +510,8 @@ format_item_1: return FAILURE; if (t != FMT_RPAREN || level > 0) { - error = _("$ must be the last specifier"); - goto syntax; + gfc_warning ("$ should be the last specifier in format at %C"); + goto optional_comma_1; } goto finished; @@ -755,8 +755,9 @@ between_desc: optional_comma: /* Optional comma is a weird between state where we've just finished - reading a colon, slash or P descriptor. */ + reading a colon, slash, dollar or P descriptor. */ t = format_lex (); +optional_comma_1: switch (t) { case FMT_COMMA: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 02089e5e012b..2eff1c87b7e7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ -2006-11-17 Francois-Xavier Coudert +2006-11-18 Francois-Xavier Coudert + + PR fortran/24285 + * gfortran.dg/dollar_edit_descriptor-3.f: New test. +2006-11-17 Francois-Xavier Coudert * gfortran.dg/use_1.f90: New test. * gfortran.dg/use_1.f90: New test. * gfortran.dg/use_1.f90: New test. diff --git a/gcc/testsuite/gfortran.dg/dollar_edit_descriptor-3.f b/gcc/testsuite/gfortran.dg/dollar_edit_descriptor-3.f new file mode 100644 index 000000000000..6e5bf6890f22 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/dollar_edit_descriptor-3.f @@ -0,0 +1,8 @@ +! { dg-do run } +! { dg-options "-std=gnu" } +! Test for dollar descriptor in the middle of a format +300 format(1000(a,$)) ! { dg-warning "should be the last specifier" } + write(*,300) "gee", "gee" + write(*,"(1000(a,$))") "foo", "bar" ! { dg-warning "should be the last specifier" } + end +! { dg-output "^geegeefoobar$" }