This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/31052] Bad IOSTAT values when readings NAMELISTs past EOF
- 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: 7 Mar 2007 06:40:54 -0000
- Subject: [Bug libfortran/31052] Bad IOSTAT values when readings NAMELISTs past EOF
- References: <bug-31052-6318@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #13 from jvdelisle at gcc dot gnu dot org 2007-03-07 06:40 -------
AFAICT A backspace is not allowed for namelist files according to 9.7.1
I interpret this to mean this is invalid code.
Further, Note 9.54 states that if the preceding record read is the EOF record,
the BACKSPACE would position the file to "before" the EOF. You can think of
this as in between the last record and the EOF record. So subsequent reads
will again read the EOF record. From the demo program, you can see the
repeated values of ios=-1, or the EOF condition returned by gfortran. So I
believe the gfortran behavior is correct.
Regardless, I do think REWIND should clear the EOF condition for namelist and I
don't think it is. I confirm this as a bug.
I am working on it.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31052