When do we ERR= on (internal) READ statements ?

Dominique Dhumieres dominiq@lps.ens.fr
Tue Dec 17 10:40:00 GMT 2013


> ... How do you handle the case when ERR is
> not present and gfortran exits with a runtime error?

Something such as

! { dg-do run }
! { dg-shouldfail "Compile-time specifier checking" }
program read
character(50) :: buf='0.D99999'
double precision val
READ (UNIT=buf, FMT='(D60.0)', ERR=800) Val
call abort
800 READ (UNIT=buf, FMT='(D60.0)') Val
End
! { dg-output "At line 8 of file.*" }
! { dg-output "Fortran runtime error: Bad value during floating point read" }

> Does it matter?

Probably not.

Dominique



More information about the Fortran mailing list