A straight gfortran applied to the code

      PROGRAM MAIN
C     .. Local Scalars ..
      INTEGER          I
C     .. Local Arrays ..
      CHARACTER*8      REC(3)
C     .. Executable Statements ..
C
      WRITE (REC,FMT=99999)
C
      DO 20 I = 1, 3
         WRITE (*,FMT=*) REC(I)
   20 CONTINUE
C
99999 FORMAT ('12345678',/'Record2',/'Record3')
      END

results in REC(1) containing '12345678', in REC(2) containing 'Record3', and in
REC(3) containing garbage.


-- 
           Summary: gfortran misses a record from a format statement
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mathewc at nag dot co dot uk


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28339

Reply via email to