libstdc++/9439: filebuf::sputbackc ignores beginning-of-file
paolo@gcc.gnu.org
paolo@gcc.gnu.org
Sun Feb 2 17:38:00 GMT 2003
Synopsis: filebuf::sputbackc ignores beginning-of-file
Responsible-Changed-From-To: unassigned->paolo
Responsible-Changed-By: paolo
Responsible-Changed-When: Sun Feb 2 17:38:23 2003
Responsible-Changed-Why:
Analyzed a bit.
State-Changed-From-To: open->feedback
State-Changed-By: paolo
State-Changed-When: Sun Feb 2 17:38:23 2003
State-Changed-Why:
Hi. I don't think there is a bug here: I cannot find in the
standard a specific prescription for the behaviour you
expect (in particular in 27.5.2.4.4) Can you?
Indeed, sputbackc calls, as expected, pbackfail, which in turns calls seekoff (fstream.tcc, line 218) (pay attention
to the preceding comment which means that this specific situation was considered and _not_ supposed to lead to an
obvious failure). The latter call then does _not_ fail and
a put back buffer is created by _M_pback_create(), hosting
the put back char, _exactly as happens_ when __testpb &&
!__testeof && !__testeq, above.
I agree that a few widespread implementations behave
differently in this case, but we are, I maintain, in the
realm of implementation defined behaviour.
Paolo.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9439
More information about the Gcc-bugs
mailing list