-
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
Implement P2467R1 ios_base::noreplace
: Exclusive Mode For fstream
s (#2932)
#3065
Conversation
Thanks! I updated your PR description to say "Fixes <issue number>", which tells GitHub to link the tracking issue and close it when this PR is merged. |
…`mode` Remove macro guards from .cpp files and use _HAS_CXX23 for the .h files. Additionally, as @MattStephanson pointed out, since _fsopen already handles the 'x' modifiers correctly, the masking out and additional check of ios_base::_Noreplace has been removed in favour of just passing it directly to _Xfsopen and adding strings for the modes there. This also avoids the "test open" to check if the file already exists which avoids a TOCTOU issue.
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.
LGTM! Thanks!
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.
Just style nits with the test, for which I'll push a cleanup.
Thanks @Atari2, this looks great! I've pushed a merge with While some ✅ Also, no changes are needed for modules, as this simply adds a |
VS 2022 17.6 Preview 1's redist will be unlocked, so we should be able to mirror this now. I've pushed a conflict-free merge with |
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for implementing this feature in a binary-compatible way! 😻 🚀 🎉 |
As was pointed out by @StephanTLavavej, since this PR has changes to
fiopen.cpp
, it will beaffects redist
.While writing the tests I tried to avoid having to change things that could affect binary compatibility but it seemed like the only option was to add the now-valid entries to the array in
_Xfiopen
, otherwise the calls to it would just fail.Fixes #2932.