This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/33307] I/O read/positioning problem



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]