The following bug occurs only in the version of gfortran downloaded from
ftp://ftp.equation.com/gcc/gcc-4.5-20090820-32.exe.

When I compile and run the program listed below it prints:

 1234567890
 1234567890
 end of file not detected

On every other port of gfortran it prints:

 1234567890
 end of file detected

PROGRAM read_character_string_bug
CHARACTER(LEN=10) :: line_10
CHARACTER(LEN=11) :: line_11
line_10 = "1234567890"
OPEN(10, FILE="test.txt", STATUS="UNKNOWN", FORM="FORMATTED")
WRITE(10, 20) line_10
20 FORMAT(a)
REWIND(10)
DO i = 1, 2
  READ(10, 20, END=99) line_11
  PRINT *, line_11
ENDDO
PRINT *, "end of file not detected"
STOP
99 PRINT *, "end of file detected"
END PROGRAM read_character_string_bug


-- 
           Summary: incorrect processing of formatted records in mingw port
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: michael dot a dot richmond at nasa dot gov
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: i386-pc-mingw32
GCC target triplet: i386-pc-mingw32


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

Reply via email to