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]
Other format: [Raw text]

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...)

$ g++ -v
Reading specs from
/home2/veksler/gnu2/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs
Configured with: ../gcc/configure --prefix=/home2/veksler/gnu2
--enable-languages=c++
Thread model: single
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;
}



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