This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: linux libio status
- To: gregg at eoeml dot gtri dot gatech dot edu (Greg Galloway)
- Subject: Re: linux libio status
- From: Joe Buck <jbuck at synopsys dot com>
- Date: Wed, 15 Oct 97 14:52:33 PDT
- Cc: egcs at cygnus dot com
> > 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++.
I don't believe that this is safe to do in general. If you're using the
5.3.12 libio you need the matching header. The problem is that some
structures have changed; this may be the cause of your crashes described
below.
> 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);
> }
The fault doesn't occur on Solaris; it may be a libio issue (possibly
tweaked by your use of the wrong libio).
> 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);
> }
Again, once I put in the missing semicolon I have no problem on Solaris.