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 libstdc++/49506] New: reusing a file stream object will always get eof after openning


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;


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