This program should return 2 zeros if the file psfres.dat consist of 2 empty
lines. This is true in case of g77, but gcc version 4.0.0 20041013 reports an
end of file error.

      integer n,m
      open(unit=8,file='psfres.dat',status='unknown')
      read(8,'(/2i2)')n,m
      write(*,*)n,m
      end

psfres.dat ( is just 2 empty lines ) If non empty then it works OK, but this is
not fortran standard. I havent check the f95 standard :-( 
The program is taken from a much larger program (CHARMM), this is why there is /
in the format. Another strange behavior is if I put numbers in the firat line
(which should be ignored), then there is no eof error in gfortran. g77 behaves
OK also in this case.

-- 
           Summary: reading empty line does not return 0
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: milan at cmm dot ki dot si
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to