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 17:38:47 -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 #1 from pcarlini at suse dot de 2006-03-28 17:38 -------
There is nothing wrong with the current behavior: simply, at the beginning of
the file a putback position cannot be made available (i.e., a seek "-1" fails),
and, consistently, sungetc() returns traits::eof(), it suffices to check the
return value. By the way, the current behavior is totally intended,
libstdc++/9439 completely clarified it (useful for some citations from the
Standard, but the key point is simply that the unavoidable low level seek
fails).
--
pcarlini at suse dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26907