[Bug libstdc++/64064] basic_filebuf seekoff return value is unusable for files opened in text mode on Windows
lh_mouse at 126 dot com
gcc-bugzilla@gcc.gnu.org
Fri Jan 19 08:18:19 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64064
--- Comment #2 from LIU Hao <lh_mouse at 126 dot com> ---
It looks that MS STL calls `_fseeki64(fp, ...)` [1], while libstdc++ calls
`lseek(_fileno(fp), ...)` [2].
The seek operation shall take the buffering of `FILE` struct into account,
hence I think the libstdc++ implementation is incorrect.
[1]
https://github.com/microsoft/STL/blob/442029c6fa37f1b6f9203357de09672d5704077c/stl/inc/__msvc_filebuf.hpp#L624
[2]
https://github.com/gcc-mirror/gcc/blob/9693459e030977d6e906ea7eb587ed09ee4fddbd/libstdc%2B%2B-v3/config/io/basic_file_stdio.cc#L425
More information about the Gcc-bugs
mailing list