libstdc++/10101: [3.0/3.2/3.3/3.4 regression] seekp() on std::strstream can break reading back from the stream
Andrew Pollard
Andrew.Pollard@brooks-pri.com
Mon Mar 24 19:46:00 GMT 2003
The following reply was made to PR libstdc++/10101; it has been noted by GNATS.
From: Andrew Pollard <Andrew.Pollard@brooks-pri.com>
To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org,
gcc-prs@gcc.gnu.org, andrew@andypo.net, bkoz@gcc.gnu.org
Cc:
Subject: Re: libstdc++/10101: [3.0/3.2/3.3/3.4 regression] seekp() on std::strstream
can break reading back from the stream
Date: Mon, 24 Mar 2003 19:06:56 +0000
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10101
[ 3rd attempt to get this into the audit trail... ]
bkoz@gcc.gnu.org commented:
> This is not a bug that I can reproduce on mainline.
>
> Patch posted here:
> http://gcc.gnu.org/ml/gcc-patches/2003-03/msg01455.html
OK, I can also confirm that it appears to work with the current CVS head
code. Although I think that it is due to the changes in
libstdc++-v3/include/std/std_streambuf.h
that went in recently...
revision 1.14
date: 2003/02/24 18:22:57; author: paolo; state: Exp; lines: +25 -30
2003-02-24 Paolo Carlini <pcarlini@unitus.it>
Nathan Myers <ncm@cantrip.org>
PR libstdc++/9404, PR libstdc++/9701 (partial)
(aka pptr == epptr implies overflow)
* include/bits/fstream.tcc (_M_allocate_internal_buffer):
Consistently, _M_out_end points to the end of the buffer just
created.
....
[ ie I think this has the effect of moving the egptr() as stuff is written
into the strstream, so that underflow isn't getting called... ]
An older version of 3.4 (CVS as of 28th Jan 2003) shows the problem that
saw.
gcc-3.2.3 and gcc-3.3 definitely have the problem.
I think my patch is probably correct for ::underflow and strstream's if
underflow actually ever gets called...
Andrew.
More information about the Gcc-prs
mailing list