From Bugzilla Helper: User-Agent: Mozilla/4.75 [en] (X11; U; Linux 2.2.16-22 i686) Description of problem: After using .seekp(0) on ostringstream object (attempting to reset the object to start fresh creating a new string) text written to the object is not written to the string. Version-Release number of selected component (if applicable): Relates to libstdc++-2.96-69 (I think). How reproducible: Always Steps to Reproduce: 1.g++ sstream.cxx 2../a.out 3. Actual Results: >x< >x< Expected Results: >x< >pr00o.dat< Additional info:
Created attachment 30554 [details] sample source code
Created attachment 30678 [details] gcc-c++-sstream-seek.patch
<sstream> is quite a new header in libstdc++ (added in April 2000, so e.g. libstdc++ 2.95.x does not have it at all) and is incomplete. As g++ 3.0 has a completely new implementation of this anyway, I'm just attaching a quick hack which IMHO should work (you can apply the patch in /usr/include/g++-3/ to test it out).
The fix is in 2.96-98.
Fixed in gcc-3.2, gcc-3.3, gcc-3.4.