This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/33307] I/O read/positioning problem
- From: "anlauf at gmx dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Sep 2007 21:09:56 -0000
- Subject: [Bug fortran/33307] I/O read/positioning problem
- References: <bug-33307-6318@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from anlauf at gmx dot de 2007-09-05 21:09 -------
Created an attachment (id=14161)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14161&action=view)
Alternative demo code
This reduced variant shows that reading fails after the second rewind.
With the same 3-line input file gfcbug69.nml I now get:
inquire: after OPEN: position = ASIS nextrec = 0
k = 1
inquire: after REWIND: position = REWIND nextrec = 0
1: read: ! ***Remove this line***
2: read: &FOO file='foo' /
inquire: after read_lines (2): position = ASIS nextrec = 0
inquire: after BACKSPACE: position = ASIS nextrec = 0
1: read: &FOO file='foo' /
2: read: &BAR file='bar' /
inquire: after read_lines (many): position = APPEND nextrec = 0
inquire: after BACKSPACE: position = APPEND nextrec = 0
k = 2
inquire: after REWIND: position = REWIND nextrec = 0
inquire: after read_lines (2): position = REWIND nextrec = 0
inquire: after BACKSPACE: position = REWIND nextrec = 0
inquire: after read_lines (many): position = REWIND nextrec = 0
inquire: after BACKSPACE: position = REWIND nextrec = 0
During the second execution of the loop body no lines are read.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33307