libstdc++/5292: Assumes streambuf::overflow returns character put

bkoz@gcc.gnu.org bkoz@gcc.gnu.org
Tue Apr 2 18:29:00 GMT 2002


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



More information about the Gcc-prs mailing list