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]

[Bug libstdc++/45628] std::fstream::tellg invalidates I/O buffer



------- Comment #5 from paolo dot carlini at oracle dot com  2010-09-10 12:36 -------
To clarify: when we start reading in a buffered mode, the first underflow reads
the buffer and leaves the physical file at the first char beyond the buffer. If
we do afterwards a seek to the current reading position, belonging to the
buffer, the physical position along the file also changes of course, an
underlying fseek is performed. Then, if we don't refresh the buffer with a new
underflow, an inconsistency is born: the physical position along the file
doesn't correspond to the first char after the buffer and the next underflow
will read from the wrong position.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45628


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