Failure reading infinity with list-directed format

Steve Edwards sgedward@korime.demon.co.uk
Sun Jul 29 14:53:00 GMT 2007


Hello,

I ran into the following while testing out gfortran with some legacy Fortran 77 codes.

cat > check1.f
      program check
      double precision value
      read(1,*)value
      print *,value
      end

cat > fort.1
+Infinity

gfortran -o check check.f

./check.f
At line 3 of file check.f (unit = 1, file = 'fort.1')
Fortran runtime error: Bad real number in item 1 of list input

I experienced this with:
GNU Fortran (GCC) 4.1.2 20070502 (Red Hat 4.1.2-12)
and
GNU Fortran (GCC) 4.3.0 20070707 (experimental)

Both ifort and sun workshoppro compiler accept this and print out:
 Infinity

Changing fort.1 to read 'INF' as per g77 output also fails.

Changing the double precision to real has no effect.

Is this a bug/regression in gfortran?

Steve E
-- 
----------------------------------------------------------
----------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070729/55a67aa0/attachment.sig>


More information about the Fortran mailing list