The following program runs with ifort, sunf95, and pathscale, but it fails with
gfortran, NAG f95 and g95. I think the number is not standard conform, but a
"processor" is allowed to accept it. For "a" ifort et al. print "4380000.0".


Additionally, I have the feeling that there is an off-by-one error in the error
message; at least I expect "2" rather than "3" in the message.


At line 4 of file test.f90
Fortran runtime error: Expected REAL for item 3 in formatted transfer, got
INTEGER



character(len=200) :: str
real :: x
str = ' 4.38000+ 6 2.55100+ 0 4.50000+ 6 2.51970+ 0 5.00000+ 6 2.40000+ 01146 3
1 171'
read(str,'(6e11.0,i4,i2,i3,i5)') a,math,mfh,mth,nsp
print *, a
end


-- 
           Summary: Reading real numbers of the form "123+ 44" (with space)
           Product: gcc
           Version: 4.5.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=43155

Reply via email to