stringstreams and stringbuf in gcc 3.2.x

Paolo Carlini pcarlini@unitus.it
Tue Feb 18 13:56:00 GMT 2003


Hi Peter,

> I am using stringstreams and was trying to manipulate the contents of 
> the stream via the associated stringbuf (via the 'sputn' method).
>
> As far as I leared by looking at the implementation in <sstream> the 
> stream uses a string as buffer. But if one enlarges the buffer the 
> (implicit?) assertion that the buffer size and the string size match 
> seems to break.

By itself, this cannot be considered a bug anymore in the light of the 
resolution of DR169. However, we are aware that there are still some 
problems affecting our implementation in this area...

> I have attached an example that produces the expected result with 
> IRIX's  CC and HP's aCC but displays a shortend version of the stream 
> with gcc 3.2. 

... luckily, that one which you have stumbled upon seems relatively easy 
to fix!

Do you have access to the sources of your gcc distribution? I'm testing 
the patch which you find attached, diffed against current mainline. It's 
just one line and you can also easily modify the sources you have by 
hand (3.2.2 perhaps?) and rebuild afterwards.

Can you possibly report here, then?

Thanks,
Paolo.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20030218/95d76742/attachment.ksh>


More information about the Libstdc++ mailing list