-
Notifications
You must be signed in to change notification settings - Fork 967
Fix documentation of __STDC__ #5431
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
base: main
Are you sure you want to change the base?
Conversation
getting `__STDC__=1` requires setting `/Za` or `/Zc:__STDC__`. It doesn't seem to matter whether/what `/std` is set to.
@puetzk : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
Learn Build status updates of commit ad233f6: ✅ Validation status: passed
For more details, please refer to the build report. |
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.
Correct as per __STDC__ not defined with std:c11.
Can you review the proposed changes? Important: When the changes are ready for publication, adding a #label:"aq-pr-triaged" |
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 is correct. Thank you.
#sign-off |
update date since content fixed
Learn Build status updates of commit b51bd8f: ✅ Validation status: passed
For more details, please refer to the build report. |
getting
__STDC__=1
requires setting/Za
or/Zc:__STDC__
. It doesn't seem to matter whether/what/std
is set to.As best I can tell (experimenting locally with Visual Studio 2022 17.14, and on compiler explorer back to 17.2), the changes made in c139817 do not seem to be accurate. setting
/std:c11
or/std:c17
do not result in having#define __STDC__ 1
. See https://godbolt.org/z/65YvxPYM3This agrees with the documentation of https://learn.microsoft.com/en-us/cpp/build/reference/zc-stdc?view=msvc-170, which says
So I suspect having
/std:c11
set__STDC__=1
may have originally been the original intent (and maybe it was true in a preview version?) but it doesn't seem to behave that way in the 17.2 or 17.14 release...