This is the mail archive of the gcc-bugs@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]

libstdc++/3955: ostringstream behaves poorly with openmode ios::app



>Number:         3955
>Category:       libstdc++
>Synopsis:       ostringstream behaves poorly with openmode ios::app
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 07 12:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Steven Barker
>Release:        3.0.1 20010801 (Debian prerelease) and 2.95.4 20010721 (Debian prerelease)
>Organization:
>Environment:
Debian GNU/Linux 2.4.4 i^86 unstable
>Description:
libstdc++ shows unexpected behavior with ostringstreams that are opened with openmode ios::app.

A testcase is attached, who's output should be
foobarbaz

with gcc 3.0.1 20010801 the output is
bazbar

with gcc 2.95.4 20010721 the output is
baz
>How-To-Repeat:
compile and execute attached testcase
>Fix:
change the behavior of ostringstream when opened with openmode ios::app

workaround: open with ios::ate (or ios::ate | ios::app if there's any difference)
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="bugtest.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bugtest.cc"

I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3N0cmVhbT4KCmludCBtYWluKCkKeyAgIAog
ICBzdGQ6Om9zdHJpbmdzdHJlYW0gYmFyKCJmb29iYXIiLCBzdGQ6Omlvczo6YXBwKTsKICAgCiAg
IGJhciA8PCAiYmF6IjsKICAgCiAgIHN0ZDo6Y291dCA8PCBiYXIuc3RyKCkgPDwgc3RkOjplbmRs
Owp9Cg==


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