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]

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.



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