This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/25340] Runtime error: "Read past ENDFILE record"
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Dec 2005 16:55:34 -0000
- Subject: [Bug libfortran/25340] Runtime error: "Read past ENDFILE record"
- References: <bug-25340-10259@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from kargl at gcc dot gnu dot org 2005-12-10 16:55 -------
What is the bug?
9.4.1.6 End-of-file branch
If an end-of-file condition (9.4.3) occurs and no error condition (9.4.3)
occurs during execution of an input statement that contains an END= specifier
(1) Execution of the input statement terminates,
(2) If the file specified in the input statement is an external file,
it
is positioned after the endfile record.
So, after the first read(11,end=1008), the file is positioned "after the
endfile
record." Your second read(11,end=1011) is reading past the ENDFILE record,
which is what the runtime error says.
Now, if your second read statement had been read(11,err=1011), then everything
should work out.
--
kargl at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25340