This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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;






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]