This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Failure reading infinity with list-directed format


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
-- 
----------------------------------------------------------
----------------------------------------------------------

Attachment: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]