fstream::eof() doesn't work on AIX

Joe Buck Joe.Buck@synopsys.COM
Wed May 2 20:09:00 GMT 2007


On Tue, May 01, 2007 at 10:29:18AM -0700, xiaoyi wang wrote:
> Hi,
>  
> I'm working with gcc 4.1.0 on AIX 5.2(RS6000) and
> encountered a problem in fstream::eof(). When
> <pthread.h> is included ahead of STL header file 
> <fstream>, fstream::eof() won't return the correct
> value when reaching to the end of the stream. If I
> include <pthread.h> after including <fstream>, my test
> program works correctly. Any ideas on what's going
> wrong?  Here is the simple test case( "text.txt" in
> this test case could be any plain text file):

It's possible that the AIX pthread.h is defining a macro that
collides with something in the <fstream> header.  To figure
out if that's happening, you'd need to look at the preprocessor
output; the -E switch will let you do that.



More information about the Libstdc++ mailing list