[Bug fortran/33400] New: Formatted read fails if line ends without line break

burnus at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Sep 11 20:40:00 GMT 2007


The following program works if one changes advance="no" into "yes". Otherwise
one gets the run-time error message:

At line 7 of file tes.f90 (unit = 20, file = 'test.dat')
Fortran runtime error: End of file

This program works with NAG f95, ifort, g95, openf95.

This is the last remaining bug to get FGSL working.
http://www.lrz-muenchen.de/services/software/mathematik/gsl/fortran/


  integer, parameter :: fgsl_strmax = 128
  character(len=fgsl_strmax) :: ieee_str1, ieee_str2
  open(unit=20, file='test.dat',form='FORMATTED')
  write(20,'(a)',advance="no") ' 1.01010101010101010101010101010101&
         &01010101010101010101*2^-2 1.01010101010101010101011*2^-2'
  rewind(20)
  read(20, fmt=*) ieee_str1, ieee_str2
  if (trim(ieee_str1) /= &
      '1.0101010101010101010101010101010101010101010101010101*2^-2') &
    stop 'ERROR'
  if (trim(ieee_str2) /= &
       '1.01010101010101010101011*2^-2') &
    stop 'ERROR'
  end


-- 
           Summary: Formatted read fails if line ends without line break
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list