------- Comment #10 from burnus at gcc dot gnu dot org 2010-03-06 09:49 ------- In terms of the standard, probably everything is OK for I/O: "The set of input/output error conditions is processor dependent." (See "9.11.1 General" for a non-definition when EOF occurs.)
Looking at other compilers: * If "X" is the only edit descriptor and there is no <EOR> marker left in the input buffer (i.e. no '\n'), an End Of File error occurs. (gfortran: No error - this PR) * If one reads, e.g. "i2" from a record where either only a record marker follows or only the end-of-file, one reads the value "0" and no error occurs. (gfortran: No error if record marker follows, but error if only eof follows. Note that reading '(a)' from "a<eof>" does not give an error while reading from "<eof>" gives an error.) * If one reads "(i2,100x,i2,100x)" or "(100x,2i2)" from a record, one gets two "0" and no error, independent whether the record buffer contains "<eof>", "<eor><eof>" or " <eof>". (gfortran: If there is a record marker, the result is the same; otherwise an EOF error occurs, unless two integer values could be read - then the trailing "100x" does not cause any error.) I think the result of the other compilers is sensible. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43265