-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix fstream.seekp(0, ios::cur)
#3773
Conversation
fstream.seekp(0, ios::cur)
fstream.seekp(0, ios::cur)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems reasonable to me.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix looks fine, but I'd like to see a regression test (a test that fails without the fix but succeeds with it) to validate it.
|
Please note that we strongly recommend configuring your editor to clang-format on save. (VSCode can do this with Microsoft's C/C++ Extension or xaver's clang-format extension, among others.) The CI system is a shared resource, so it's best to avoid putting unnecessary load on it. |
Thanks for fixing this bug and testing the fix! 😻 I validated and pushed minor cleanups to the test. |
There's also a cmake |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll push a change to run the test in C++14 mode.
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks again for this correctness fix! 🐞 ✅ 💯 |
This reverts commit 518f449.
Fixes #3572. As discovered in the issue, we need
fseek
for side effects even when(off,way)==(0,ios::cur)
.