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

[3.11] gh-99069: Consolidate checks for static_assert (GH-94766) #103282

Merged
merged 1 commit into from
Apr 5, 2023

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Apr 5, 2023

Several platforms don't define the static_assert macro despite having
compiler support for the _Static_assert keyword. The macro needs to be
defined since it is used unconditionally in the Python code. So it
should always be safe to define it if undefined and not in C++11 (or
later) mode.

Hence, remove the checks for particular platforms or libc versions,
and just define static_assert anytime it needs to be defined but isn't.
That way, all platforms that need the fix will get it, regardless of
whether someone specifically thought of them.

Also document that certain macOS versions are among the platforms that
need this.

The C2x draft (currently expected to become C23) makes static_assert
a keyword to match C++. So only define the macro for up to C17.

(cherry picked from commit 96e1901)

Co-authored-by: Joshua Root jmr@macports.org
Co-authored-by: Victor Stinner vstinner@python.org

Several platforms don't define the static_assert macro despite having
compiler support for the _Static_assert keyword. The macro needs to be
defined since it is used unconditionally in the Python code. So it
should always be safe to define it if undefined and not in C++11 (or
later) mode.

Hence, remove the checks for particular platforms or libc versions,
and just define static_assert anytime it needs to be defined but isn't.
That way, all platforms that need the fix will get it, regardless of
whether someone specifically thought of them.

Also document that certain macOS versions are among the platforms that
need this.

The C2x draft (currently expected to become C23) makes static_assert
a keyword to match C++. So only define the macro for up to C17.

(cherry picked from commit 96e1901)

Co-authored-by: Joshua Root <jmr@macports.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good bot.

@miss-islington miss-islington merged commit 851e744 into python:3.11 Apr 5, 2023
@miss-islington miss-islington deleted the backport-96e1901-3.11 branch April 5, 2023 15:44
th0ma7 added a commit to th0ma7/spksrc that referenced this pull request Jul 3, 2023
This fix python/cpython#103282 actually
breaks things using GCC 4.6.4 when enforcing c99.
th0ma7 added a commit to th0ma7/spksrc that referenced this pull request Jul 13, 2023
This fix python/cpython#103282 actually
breaks things using GCC 4.6.4 when enforcing c99.
th0ma7 added a commit to SynoCommunity/spksrc that referenced this pull request Jul 19, 2023
* python310: Update from version 3.10.11 to 3.10.12

* python311: Update from version 3.11.3 to 3.11.4

* cryptography: Update from version 40.0.2 to 41.0.1

* py310-311: Downgrade Pillow from 10.0.0 to 9.5.0

* py310-311: Numpy 1.25.x require c++17

* py311: Revert static_assert undefined fix GH-94766

This fix python/cpython#103282 actually
breaks things using GCC 4.6.4 when enforcing c99.

* py310-311: Rename requirement file to match greenlet versions

* py310-311: (re)Disable testing all wheels

* mariadb-connector-c: Update from version 3.3.4 to 3.3.5

* openssl3: Fix building on aarch64 on DSM 6.x

* mariadb-connector-c: Fix build on armv5 (required -std=gnu99)

* mariadb-connector-c: Fix is actually required for GCC < 5.0

* py310-311: Major bump to openssl3

* python311: (re)Disable testing all wheels

* openssl3: Revert disabling of ASM for aarch64 in favor of #5809
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.

4 participants