This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/45628] std::fstream::tellg invalidates I/O buffer
- From: "paolo dot carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Sep 2010 04:27:46 -0000
- Subject: [Bug libstdc++/45628] std::fstream::tellg invalidates I/O buffer
- References: <bug-45628-18186@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #31 from paolo dot carlini at oracle dot com 2010-09-11 04:27 -------
I'm afraid that the situation I outlined in Comment #5 is just the simple one.
The real problem with the new scheme - which tries to deal specially with (0,
cur) by not moving the file pointer - is when *writes* follow the seek. After a
while the buffer becomes full and must be flushed to the file starting at the
logical position corresponding to the previous seek. Thus - it seems to me -
the file pointer must be finally adjusted. How to do that without saving
anything in the filebuf? (note that within the current ABI we cannot add data
members)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45628