gh-118124: fix assert related C++ checks on Solaris/Illumos#121974
gh-118124: fix assert related C++ checks on Solaris/Illumos#121974vstinner merged 2 commits intopython:mainfrom
Conversation
Include/pymacro.h
Outdated
| // not defined), and only for C11-17. | ||
| #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.
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.
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