The following simple program is rejected by gfortran (commandline: gfortran junk.f) with this error message: In file junk.f:6 * 1.4) 1 Error: Period required in format string at (1) In file junk.f:4 write(6,10) x 1 Error: FORMAT label 10 at (1) not defined c------------------------------ begin test program program junk real x read(5,*) x write(6,10) x 10 format(g1 * 1.4) end c------------------------------- end test program The compilation succeeds with gcc 3.3.x and earlier The compilation also succeeds if one removes the blanks beetwen the line continuation and 1.4 in the format statement. additional info gfortran -v Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: ../configure --prefix=/home/iwan/gcc4.0.2 --enable-threads=posix --enable-__cxa_atexit -enable-languages=c,c++,f95 Thread model: posix gcc version 4.0.2
Confirmed on latest 4.1 cvs.
Confirmed.
Created attachment 10339 [details] A one line change that seems to fix Bug 24268 Have tested the change on several large fortran 77 source files. I'm not sure if a similar change is needed for case '+' in format_lex().
I am looking into this.
Subject: Bug 24268 Author: jvdelisle Date: Fri Dec 16 23:44:14 2005 New Revision: 108695 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108695 Log: 2005-12-16 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/24268 * io.c (format_lex): Allow whitespace within text of format specifier. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/io.c
Subject: Bug 24268 Author: jvdelisle Date: Fri Dec 16 23:49:33 2005 New Revision: 108696 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108696 Log: 2005-12-16 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/24268 * gfortran.dg/fmt_white.f: New test. Added: trunk/gcc/testsuite/gfortran.dg/fmt_white.f Modified: trunk/gcc/testsuite/ChangeLog
Subject: Bug 24268 Author: jvdelisle Date: Wed Dec 21 06:51:02 2005 New Revision: 108899 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108899 Log: 2005-12-20 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/24268 * io.c (format_lex): Allow whitespace within text of format specifier. Modified: branches/gcc-4_1-branch/gcc/fortran/ChangeLog branches/gcc-4_1-branch/gcc/fortran/io.c
Subject: Bug 24268 Author: jvdelisle Date: Wed Dec 21 06:52:38 2005 New Revision: 108900 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108900 Log: 2005-12-20 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/24268 * gfortran.dg/fmt_white.f: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/fmt_white.f Modified: branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
This is now fixed for the specific test case. 4.1 and 4.2 are in sync. I plan to go back and review for other possible cases of whitespace. Just want to keep this synchronized.
Submitted a new patch for approval that is a final fix for this bug.
Subject: Bug 24268 Author: jvdelisle Date: Fri Jan 6 01:21:56 2006 New Revision: 109402 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109402 Log: 2006-01-01 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/24268 * io.c (next_char_not_space): New function that returns the next character that is not white space. (format_lex): Use the new function to skip whitespace within a format string. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/io.c
Subject: Bug 24268 Author: jvdelisle Date: Fri Jan 6 01:28:40 2006 New Revision: 109404 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109404 Log: 2005-01-05 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/24268 * gfortran.dg/fmt_white.f: Update test. Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/fmt_white.f
Subject: Bug 24268 Author: jvdelisle Date: Sun Jan 8 01:53:06 2006 New Revision: 109467 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109467 Log: 2006-01-07 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/24268 * io.c (next_char_not_space): New function that returns the next character that is not white space. (format_lex): Use the new function to skip whitespace within a format string. Modified: branches/gcc-4_1-branch/gcc/fortran/ChangeLog branches/gcc-4_1-branch/gcc/fortran/io.c
Subject: Bug 24268 Author: jvdelisle Date: Sun Jan 8 01:56:22 2006 New Revision: 109468 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109468 Log: 2005-01-07 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/24268 * gfortran.dg/fmt_white.f: Update test. Modified: branches/gcc-4_1-branch/gcc/testsuite/ChangeLog branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/fmt_white.f
Fixed on 4.1 and 4.2