This is the mail archive of the gcc-prs@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]
Other format: [Raw text]

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


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


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