This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/26907] Two times filebuf::sungetc() at beginning of file gives undefined result
- From: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Mar 2006 21:15:06 -0000
- Subject: [Bug libstdc++/26907] Two times filebuf::sungetc() at beginning of file gives undefined result
- References: <bug-26907-12424@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from pcarlini at suse dot de 2006-03-28 21:15 -------
(In reply to comment #2)
> My opinion is, that an abitrary number of sungetc() at the beginning of a file
> should not have the effect, that the next sbumpc() returns the first character
> of the file. Independent to the state of the buffer. This is not the case. The
> example code proves, that under certain cirumstances a sbumpc() does _not_
> return the first character of the file.
And this is not true: any number of sungetc() at the beginning of the file
fails (all return eof()) and the next sbumpc() exactly returns the first char
of file. Indeed, If I run your testcase (with the testcase itself as test.dat)
I get:
#
#-35
And all the implementations I tried (besides v3) do the same.
--
pcarlini at suse dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26907