This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++/5292: Assumes streambuf::overflow returns character put
- From: bkoz at gcc dot gnu dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, paolo at gcc dot gnu dot org, ron at vaniwaarden dot org, vaniwaar at ca dot metsci dot com
- Date: 3 Apr 2002 02:29:58 -0000
- Subject: Re: libstdc++/5292: Assumes streambuf::overflow returns character put
- Reply-to: bkoz at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, paolo at gcc dot gnu dot org, ron at vaniwaarden dot org, vaniwaar at ca dot metsci dot com, gcc-gnats at gcc dot gnu dot org
Synopsis: Assumes streambuf::overflow returns character put
State-Changed-From-To: feedback->closed
State-Changed-By: bkoz
State-Changed-When: Tue Apr 2 18:29:57 2002
State-Changed-Why:
This is not a bug.
27.5.2.2.5 - Put area [lib.streambuf.pub.put]
streambuf::sputc
returns:
if no write, overflow(traits::to_int_type(c))
else traits::to_int_type(c)
You'll notice that the libstdc++-v3 implementation does this.
27.5.2.4.5 - Put area [lib.streambuf.virt.put]
overflow always returns c on success, unless c == EOF, in which it
returns not_eof().
Overflow never returns EOF on success, so your change is not
necessary, and indeed, would be non-conforming.
Furthermore, your testcase appears to work with current gcc-3.1 sources.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5292