This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gfortran] patch for PR 14906 - run time error on blank formatstring
- From: Bud Davis <bdavis9659 at comcast dot net>
- To: gfortran <fortran at gcc dot gnu dot org>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 15 Apr 2004 21:22:50 -0500
- Subject: [gfortran] patch for PR 14906 - run time error on blank formatstring
it is true that code has been written to expect an
empty format statemet, like in NIST test FM406.FOR.
test suite file:
! from NIST test FM406.FOR
CHARACTER*10 A10VK
A10VK = 'XXXXXXXXXX'
WRITE(A10VK,39110)
39110 FORMAT()
!
! the empty format should fill the target of the internal
! write with blanks.
!
IF (A10VK.EQ.'XXXXXXXXXX') THEN
! PRINT*,A10VK
CALL ABORT
ENDIF
END
Change log
2004-04-15 Bud Davis <bdavis9659@comcast.net>
PR fortran/14906
* io/format.c (format_item): gracefully handle a ')'
when it is the first character encountered in the string.
Unfortunately, FM406 does not pass after this patch, it just runs to
completion with errors.
No additional test suite failures, tested i686/gnu/linux FC1.
--bud
Index: gcc/libgfortran/io/format.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/io/Attic/format.c,v
retrieving revision 1.1.2.3
diff -c -3 -p -r1.1.2.3 format.c
*** gcc/libgfortran/io/format.c 19 Sep 2003 19:11:12 -0000 1.1.2.3
--- gcc/libgfortran/io/format.c 11 Apr 2004 17:50:20 -0000
*************** format_item:
*** 620,625 ****
--- 620,628 ----
case FMT_BADSTRING:
goto finished;
+ case FMT_RPAREN:
+ goto finished;
+
default:
error = unexpected_element;
goto finished;