This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/30009] Unformatted reads exceeding storage units gives EOF instead of ERR
- From: "jvdelisle at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Dec 2006 23:31:58 -0000
- Subject: [Bug libfortran/30009] Unformatted reads exceeding storage units gives EOF instead of ERR
- References: <bug-30009-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from jvdelisle at gcc dot gnu dot org 2006-12-02 23:31 -------
Please note the subtle difference with this case while working this:
WRITE(1) 1
REWIND(1)
READ(1,ERR=10) I
READ(1,END=10) J
print *,"no error"
stop
10 print *,"error value"
end
This is a true EOF condition and gfortran gets that right. Ifort and gfortran
agree on this behavior as well.
Also note that EOF and EOR are not the same as ERR. ERR would imply something
more serious then EOF or EOR which would be considered normal things to
encounter, like reading until you find the end of a file and then stopping as
opposed to a bad sector on a disk.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30009