Avoid using MSVC-internal _STRINGIZE#6970
Merged
ppenzin merged 1 commit intochakra-core:masterfrom Jul 3, 2024
StephanTLavavej:stringize
Merged
Avoid using MSVC-internal _STRINGIZE#6970ppenzin merged 1 commit intochakra-core:masterfrom StephanTLavavej:stringize
_STRINGIZE#6970ppenzin merged 1 commit intochakra-core:masterfrom
StephanTLavavej:stringize
Conversation
7 tasks
vicroms
pushed a commit
to microsoft/vcpkg
that referenced
this pull request
Mar 8, 2024
Microsoft's C++ standard library recently merged microsoft/STL#4405 to remove the internal `_STRINGIZE` macro. `chakracore` was using this MSVC internal macro, so `avoid_msvc_internal_STRINGIZE.patch` was added to adapt it to the microsoft/STL changes. Reference: chakra-core/ChakraCore#6970. - [x] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [ ] ~SHA512s are updated for each updated download.~ - [ ] ~The "supports" clause reflects platforms that may be fixed by this new version.~ - [ ] ~Any fixed [CI baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt) entries are removed from that file.~ - [ ] ~Any patches that are no longer applied are deleted from the port's directory.~ - [x] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [x] Only one version is added to each modified port's versions file. --------- Co-authored-by: Monica <v-liumonica@microsoft.com>
Collaborator
|
Hi @StephanTLavavej thank you for the heads up about this pending breakage. Looking at the code it looks to me like only bin/NativeTests/stdafx.h would be broken and the other two instances whilst using a similar name already defined alternative macros; is that correct? Did you rename the others for consistency? |
Contributor
Author
|
Yes, I renamed them to consistently follow the Standard's rules for reserved identifiers, and to make it easier to verify that there are no remaining dependencies on microsoft/STL's removed macro. |
bhmohanr-techie
added a commit
to bhmohanr-techie/ChakraCore
that referenced
this pull request
Jul 2, 2024
Avoid using MSVC-internal _STRINGIZE chakra-core#6970 Below is the comment from Stephan T. Lavavej in the above mentioned pull request: "I work on Microsoft's C++ Standard Library implementation, where we recently merged microsoft/STL#4405 to remove our internal _STRINGIZE macro. Our "Real World Code" test suite, which builds popular open-source projects like yours, found that you were using this MSVC-internal macro and therefore our change broke your code. The C++ Standard's rule is that _Leading_underscore_capital identifiers (including _LEADING_UNDERSCORE_ALL_CAPS) are reserved for the compiler and Standard Library, so other libraries and applications should avoid using such reserved identifiers. This is N4971 5.10 [lex.name]/3: In addition, some identifiers appearing as a token or preprocessing-token are reserved for use by C++ implementations and shall not be used otherwise; no diagnostic is required. — Each identifier that contains a double underscore __ or begins with an underscore followed by an uppercase letter is reserved to the implementation for any use. This PR introduces non-reserved names that will work on all platforms."
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I work on Microsoft's C++ Standard Library implementation, where we recently merged microsoft/STL#4405 to remove our internal
_STRINGIZEmacro. Our "Real World Code" test suite, which builds popular open-source projects like yours, found that you were using this MSVC-internal macro and therefore our change broke your code.The C++ Standard's rule is that
_Leading_underscore_capitalidentifiers (including_LEADING_UNDERSCORE_ALL_CAPS) are reserved for the compiler and Standard Library, so other libraries and applications should avoid using such reserved identifiers. This is N4971 5.10 [lex.name]/3:This PR introduces non-reserved names that will work on all platforms.