This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/49506] New: reusing a file stream object will always get eof after openning
- From: "gzljg at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 22 Jun 2011 20:31:20 +0000
- Subject: [Bug libstdc++/49506] New: reusing a file stream object will always get eof after openning
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49506
Summary: reusing a file stream object will always get eof after
openning
Product: gcc
Version: 3.3.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: gzljg@hotmail.com
Created attachment 24581
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24581
test programe to reproduce the file stream open-eof bug
It seems that if I reuse a std::ifstream object by "open(another_file)" it will
always return EOF right away. See the attached file for details.
I had confirmed this can be reproduced with gcc 3.3.3 but NOT in gcc 4.3.3.
(Not sure which exact version fixed the problem -- I had searched the similar
bug description but could not find one ).
In a good case, the test program should return 0 silently.
In a bad case, the test program print out "eof" and some of the bits of the
stream state and return 1;