I/O runtime bug in 4.8

Keith Refson krefson@gmail.com
Sat Mar 23 12:07:00 GMT 2013


There is a bug in the I/O runtime in 4.8.0.  The program:

program iotest

    character(len=258) :: inp = ' 1.0 1.0 1.0'

    integer :: ios
    real :: a1, a2, a3, a4

    read(inp,*,iostat=ios) a1, a2, a3, a4

    write(*,*) 'IOSTAT=',ios
end program iotest

generates incorrect output:

$ ./a.out
  IOSTAT=           0

The expected behaviour, and the behaviour under 4.7.1 is

$ ./a.out
  IOSTAT=          -1

as there are fewer variables in the I/O list than in the record.

I have reported this a bug #56696 in the gcc bugzilla.

sincerely

Keith Refson



More information about the Fortran mailing list