libstdc++/4289: ifstream fails to reset on ifstream::close() after EOF encountered.

pme@gcc.gnu.org pme@gcc.gnu.org
Tue Sep 18 16:12:00 GMT 2001


Synopsis: ifstream fails to reset on ifstream::close() after EOF encountered.

State-Changed-From-To: open->closed
State-Changed-By: pme
State-Changed-When: Tue Sep 18 16:12:03 2001
State-Changed-Why:
    Thank you for your bug report.
    
    > upon ifstream::close() and another ifstream::open() (on the
    > same stream, but not neccesarily the same file) the EOF flag
    > and file position are not reset.
    
    As you noted, the C++ standard does not specify that the
    state flags should be cleared when a file is opened.  (Yes,
    it sucks.)  The library working group has a defect report (#22)
    on their issues list, unfortunately, the proposed resolution
    states that for open() effects, the text "A successful open
    does not change the error state." should be added.  Which is
    what currently happens (or rather, doesn't happen).
    
    The workaround you noted, of calling clear() directly, is the
    only thing that can be done.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4289&database=gcc



More information about the Gcc-bugs mailing list