This is the mail archive of the gcc@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]

Re: linux libio status


I previously wrote:
> 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);
> }
> 

My previous problems with strstream and dynamically allocated buffers appears
to be gone.

Upon looking at the call trace in gdb this program goes into an infinite 
recursion on the basic_string<> ctor until __builtin_new() finally dies 
giving a segmentation fault.

Greg
----
Gregory L. Galloway
Research Scientist I

http://eoeml.gtri.gatech.edu/home/gregg/


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