------- Comment #3 from burnus at gcc dot gnu dot org 2009-04-14 08:09 ------- > I think gfortran has this right. This is an attempt to read from an internal > unit of length zero. Try the same operation from a zero length file.
I'm not sure whether gfortran is right, but my program from comment 0 works with NAG f95, ifort, sunf95, openf95, g95, pathf95, pgf95 - and only fails with gfortran. The following program (using a zero-length file) works with all of the compilers above - and it also works with gfortran: implicit none character(len=5) :: str integer :: a str = '' a = 5 open(16,form='formatted') write(16,'(a)') '' rewind(16) read(16,'(5x,i1)') a close(16,status='delete') print *, a if(a /= 0) stop 'Error' end * * * The following vendor extension would be nice; it works with ifort, sunf95, openf95, pgf95, pathf95: implicit none character(len=5) :: str logical :: a str = '' a = .true. read(str,'(L1)') a ! Extension: Blanks are read as .false. print *, a if(a .neqv. .false.) stop 'error' end -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39587