Bug 53011 - Malfunction with seekp and ostringstream
Malfunction with seekp and ostringstream
Product: Red Hat Linux
Classification: Retired
Component: libstdc++ (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2001-09-01 14:47 EDT by Randy Cushman
Modified: 2007-04-18 12:36 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-10-01 11:30:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
sample source code (375 bytes, text/plain)
2001-09-01 14:52 EDT, Randy Cushman
no flags Details
gcc-c++-sstream-seek.patch (4.21 KB, patch)
2001-09-03 06:50 EDT, Jakub Jelinek
no flags Details | Diff

  None (edit)
Description Randy Cushman 2001-09-01 14:47:38 EDT
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:

Steps to Reproduce:
1.g++ sstream.cxx

Actual Results:  >x<

Expected Results:  >x<

Additional info:
Comment 1 Randy Cushman 2001-09-01 14:52:20 EDT
Created attachment 30554 [details]
sample source code
Comment 2 Jakub Jelinek 2001-09-03 06:50:15 EDT
Created attachment 30678 [details]
Comment 3 Jakub Jelinek 2001-09-03 06:53:39 EDT
<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).
Comment 4 Jakub Jelinek 2001-09-06 12:04:54 EDT
The fix is in 2.96-98.
Comment 5 Benjamin Kosnik 2004-10-01 11:30:53 EDT
Fixed in gcc-3.2, gcc-3.3, gcc-3.4.

Note You need to log in before you can comment on or make changes to this bug.