linux libio status
H.J. Lu
hjl@lucon.org
Thu Oct 16 12:58:00 GMT 1997
>
> Richard Henderson wrote:
> > Joe Buck wrote:
> > > We need to silence these warnings. For the NULL, I suggest a global
> > > s/NULL/0/ in the C++ iostreams headers.
> >
> > That's a reasonable solution. In my version of the libio patches,
> > I make _G_config.h undef and redefine NULL to avoid this problem.
> >
> > > I don't know where the missing declarations should go; perhaps HJ has
> > > an idea.
> >
> > I worked around this for Linux/Alpha by providing versions of
> > libc-lock.h and stdio-lock.h to install with the newly built library.
> > Perhaps we do the same thing for Intel?
>
> I worked around this by copying egcs-971009/libio/libio.h into
> /usr/include/g++.
That is one way to fix it.
>
> By the way strstream seems to be broken if you let it dynamically allocate
> it's own buffer. The following program gives a segmentation fault:
>
> #include <cstdlib>
> #include <string>
> #include <strstream.h>
> main()
> {
> ostrstream os;
> os << "testing " << 123 << ends;
> string s = os.str();
> exit(0);
> }
>
> This one used to work for me under gcc-2.7.2.1 but is also broken with egcs:
>
> #include <cstdlib>
> #include <string>
> #include <strstream.h>
> main()
> {
> char buf[100]
> ostrstream os(buf, 100);
> os << "testing " << 123 << ends;
> string s = os.str();
> exit(0);
> }
Both work for me with libc 5.4.39.
H.J.
More information about the Gcc
mailing list