libstdc++/9439: filebuf::sputbackc ignores beginning-of-file
peturr02@ru.is
peturr02@ru.is
Sat Jan 25 12:06:00 GMT 2003
>Number: 9439
>Category: libstdc++
>Synopsis: filebuf::sputbackc ignores beginning-of-file
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Jan 25 12:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: peturr02@ru.is
>Release: gcc-3.2.1
>Organization:
>Environment:
Red Hat Linux 8.0
>Description:
filebuf::sputbackc succeeds even if the filebuf is already at the beginning of the file. I don't think this makes much sense, sputbackc should fail at the beginning.
>How-To-Repeat:
See attachment.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="pbackfailbug2.cc"
Content-Disposition: inline; filename="pbackfailbug2.cc"
#include <fstream>
#include <cstdio>
using namespace std;
#undef NDEBUG
#include <cassert>
int main()
{
filebuf fbuf;
fbuf.open("pbackfailbug2.cc", ios_base::in);
int r = fbuf.sputbackc('a');
assert(r == EOF);
return 0;
}
More information about the Gcc-prs
mailing list