This is the mail archive of the gcc-bugs@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]

libstdc++/9439: filebuf::sputbackc ignores beginning-of-file


>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;
}


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