-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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
gh-118124: fix assert related C++ checks on Solaris/Illumos #121974
Conversation
Include/pymacro.h
Outdated
#if !defined(static_assert) && (defined(__GNUC__) || defined(__clang__)) \ | ||
&& defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \ | ||
&& !defined(__cplusplus) && __STDC_VERSION__ >= 201112L \ |
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'd keep defined(__STDC_VERSION__)
and add && !defined(__cplusplus)
to the end. I believe it was there for some reason, e.g. GCC and Clang may warn undefined identifiers(-Wundef
).
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.
You are right, better be safe here. I kept the defined(__STDC_VERSION__)
in the check.
cc @vstinner as the author of the original fix |
Sorry, @kulikjak and @vstinner, I could not cleanly backport this to
|
Do 3.12 and 3.13 branches need backport? I cannot check right now. |
So, the second The first I can prepare backport PRs. |
If 3.12 and 3.13, backports would be welcomed, sure. |
…mos (pythonGH-121974) Fix check for static_assert() for C++ on some platforms.. (cherry picked from commit e88bd96) Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
GH-122108 is a backport of this pull request to the 3.13 branch. |
GH-122109 is a backport of this pull request to the 3.12 branch. |
__STDC_VERSION__
can be defined for C++ builds on some platforms (in my case, Solaris/Illumos).https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57025