When do we ERR= on (internal) READ statements ?
Steve Kargl
sgk@troutmask.apl.washington.edu
Wed Dec 18 23:44:00 GMT 2013
On Tue, Dec 17, 2013 at 11:40:55AM +0100, Dominique Dhumieres wrote:
> > ... 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" }
>
Thanks. Committed.
--
Steve
More information about the Fortran
mailing list