This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
libstdc++/9439: filebuf::sputbackc ignores beginning-of-file
- From: peturr02 at ru dot is
- To: gcc-gnats at gcc dot gnu dot org
- Date: 25 Jan 2003 11:57:17 -0000
- Subject: libstdc++/9439: filebuf::sputbackc ignores beginning-of-file
- Reply-to: peturr02 at ru dot is
>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;
}