This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: strstream.h (deprecated) is broken
- From: Joe Buck <Joe dot Buck at synopsys dot com>
- To: VEKSLER at il dot ibm dot com (Michael Veksler)
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 31 May 2002 10:42:49 -0700 (PDT)
- Subject: Re: strstream.h (deprecated) is broken
> I get a segmentation fault when using strstream (yes I know it is
> deprecated, but I need to support older compilers for my customers...)
> gcc version 3.2 20020530 (experimental)
>
> $ g++ -Wno-deprecated t.cpp
> $ ./a.out
> Segmentation fault (core dumped)
> $ cat t.cpp
> #include <strstream.h>
> #include <iostream>
>
> int main()
> {
> strstream s;
> for (unsigned i=0 ; i!= 8 ; ++i)
> s << i << std::endl;
> s << std::ends;
>
> return 0;
> }
The program works in 3.1, so presumably this is a recently introduced
bug. Please file a bug report (see http://gcc.gnu.org/bugs.html).
A better test case would have something like
std::cout << s.str();
at the end.