fstream::eof() doesn't work on AIX
xiaoyi wang
xyaswang@yahoo.com
Thu May 3 00:03:00 GMT 2007
Hi,
Thanks for your suggestions. I just figured out that I
need to use "-pthread" to compile and link the
application in order to get the correct behavior.
Christina
>
> --- Joe Buck <Joe.Buck@synopsys.COM> wrote:
>
> > 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.
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the Libstdc++
mailing list