Skip to content

[3.15] gh-160704: Restore C11-C17 static_assert fallback (GH-160705) - #160825

Merged
encukou merged 1 commit into
python:3.15from
miss-islington:backport-a7ac7a8-3.15
Oct 28, 2026
Merged

encukou merged 1 commit into
python:3.15from
miss-islington:backport-a7ac7a8-3.15

Conversation

@miss-islington

@miss-islington miss-islington commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

_Py_STDC_VERSION needs to be defined before its value can be checked.
In 8335bcb (gh-160208: Add a private wrapper around STDC_VERSION
(GH-160376), 2026-10-23), the condition defined(_Py_STDC_VERSION) is
incorrectly negated, which prevents the fallback definition of
static_assert in C11-C17 builds and causes a build error when building
with an old C library that does not define static_assert.
(cherry picked from commit a7ac7a8)

Co-authored-by: Ruoyu Zhong zhongruoyu@outlook.com
Signed-off-by: Ruoyu Zhong zhongruoyu@outlook.com

…60705)

`_Py_STDC_VERSION` needs to be defined before its value can be checked.
In 8335bcb (pythongh-160208: Add a private wrapper around __STDC_VERSION__
(pythonGH-160376), 2026-10-23), the condition `defined(_Py_STDC_VERSION)` is
incorrectly negated, which prevents the fallback definition of
`static_assert` in C11-C17 builds and causes a build error when building
with an old C library that does not define `static_assert`.
(cherry picked from commit a7ac7a8)

Co-authored-by: Ruoyu Zhong <zhongruoyu@outlook.com>
Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
@encukou
encukou enabled auto-merge (squash) October 28, 2026 14:29
@encukou
encukou merged commit 9b6a1a1 into python:3.15 Oct 28, 2026
56 checks passed
@miss-islington
miss-islington deleted the backport-a7ac7a8-3.15 branch October 28, 2026 14:56
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.

3 participants