With a recent gfortran, the following compiles, but generates the wrong
results:

character(len=20) :: b
! write something no advance
open(10,FILE="fort.10",POSITION="REWIND")
write(10, '(a,t1,a)',advance='no') 'XXXXXX', 'ABC'
close(10)
! append some data
open(10,FILE="fort.10",POSITION="APPEND")
write(10, '(a)') 'DEF'
close(10)
! check what is in the first record
open(10,FILE="fort.10",POSITION="REWIND")
read(10,'(a)') b
IF (b.NE."ABCXXX") CALL ABORT()
END


-- 
           Summary: wrong code generated with gfortran
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk


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

Reply via email to