[flang] incorrect iostat for failed list-separated read into real #137776
Labels
flang:runtime
question
A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
There appears to be some (possibly) non-standard conforming behaviour concerning the reading of an internal file (string) containing
..
into a real variable. Consider the following program:The
str
containing..
when read intox
gives0.0
withiostat=0
for success (likewise,iostat
is omitted, no runtime error is raised). This appears to be possibly non-standard conforming behaviour, as various other compilers such as ifort, Cray Fortran and gfortran all raise a runtime error (and will also return non-zeroiostat
codes).I suspect it has to do with the interpretation decimal point as if
str
is initialised tohi
, then a non-zeroiostat
value is returned as expected. Similarly, if thedecimal="comma"
argument is passed into theread
statement, a non-zero value foriostat
is also returned.Compiler explorer link: https://godbolt.org/z/9doTaGqKT
The text was updated successfully, but these errors were encountered: