When do we ERR= on (internal) READ statements ?
Toon Moene
toon@moene.org
Mon Dec 16 18:28:00 GMT 2013
[ God rest ye ] Merry Gentlemen,
Erik Kruyt provided me with an interesting case:
program read
character(50) :: buf='0.D99999'
double precision val
READ (UNIT=buf, FMT='(D60.0)', ERR=800) Val
stop 'ok'
800 print *, 'error'
End
Apparently, the internal read aborts due to the large exponent:
$ ./a.out
a.out: ../../../src/libgfortran/io/read.c:1131: read_f: Assertion
`exponent < 10000' failed.
Program received signal SIGABRT: Process abort signal.
Backtrace for this error:
#0 0x7F9E4EC10607
#1 0x7F9E4EC10C0E
#2 0x7F9E4E13124F
#3 0x7F9E4E1311D5
#4 0x7F9E4E134387
#5 0x7F9E4E12A251
#6 0x7F9E4E12A301
#7 0x7F9E4ECD051D
#8 0x7F9E4ECD2C8C
#9 0x40097F in MAIN__ at kruyt.f90:?
Aborted
Is that the behavior we want, or should the ERR= label be honored ?
Kind regards,
--
Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/
Progress of GNU Fortran: http://gcc.gnu.org/wiki/GFortran#news
More information about the Fortran
mailing list