This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: [PATCH] Fix fortran/13257, Error instead of warning for missingcommain format string


Richard E Maine wrote:
>>Another data point how difficult it is to properly parse Fortran 
>>programs.
>>I have the following program:
>>      SUBROUTINE TEST
>>      IMPLICIT INTEGER(A-Z)
>>      DIMENSION FORMAT(10), ENTRYA(2,2,2,2,2,2,2), H(2)
>>      DATA FORMAT /10*0/, ENTRYA /128*0/, H /2*1/
>>      DATA A/1/, B/1/, C/1/, D/1/, E/1/, F/1/, G/1/
>>      DATA X5H/1/
>>      ENTRY A(A,B,C,D,E,F,G) = 1
>>100   FORMAT(X5H)=H(A)
>>      PRINT *, ENTRYA(1,1,1,1,1,1,1)
>>      PRINT *, FORMAT(1)
>>      PRINT 100
>>      END
>>      CALL TEST
>>      END
>>This ought to fail on the line 'PRINT 100'  It does so with many 
>>compilers,

Thank you very much for digging this out.  Andrew, how does this interact with
your patch?  A slightly reduced testcase (no more ENTRYA):

      IMPLICIT INTEGER
      DIMENSION FORMAT (2), H(1)
      X5H = 1 ; H = 1 ; FORMAT = 0
100   FORMAT(X5H)=H(A)
      IF (FORMAT(X5H) /= 1) CALL ABORT ()
!     PRINT 100  ! should give an error
      END

Maybe we should be more restrictive about the places in which commas can be
omitted?

- Tobi


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