Skip to content
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

Avoid using MSVC-internal _STRINGIZE #499

Merged
merged 1 commit into from
Mar 7, 2024
Merged

Avoid using MSVC-internal _STRINGIZE #499

merged 1 commit into from
Mar 7, 2024

Conversation

StephanTLavavej
Copy link
Contributor

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.

Fortunately, your usage was very limited and you already had a fallback for non-MSVC platforms, so it's simple to rename the affected macros.

Related PR: 3rdparty/stout#72

@bmahler bmahler merged commit 457c201 into apache:master Mar 7, 2024
@StephanTLavavej StephanTLavavej deleted the stringize branch March 7, 2024 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants