You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python 3.11 and newer versions use C11 without optional features. The public C API should be compatible with C++.
However, CPython now requires #include <stdatomic.h> (an optional C11 feature) or MSVC. (Mimalloc can use C++ atomics, C11 atomics, or MSVC atomics. And pyatomic.h requires C11 atomics, MSVC atomics, or GCC atomics. The intersection is C11 or MSVC.)
This means CPython can't compile with GCC 4.8, as C11 atomics were added in GCC 4.9. See this buildbot failure for example. Granted, GCC 4.9 is very old and we can probably drop it, but I don't know how other compilers are affected.
The text was updated successfully, but these errors were encountered:
You can build CPython with GCC 4.8. Mimalloc is optional in the default build and is disabled by configure if stdatomic.h is not available.
I'm not sure what went wrong with the buildbot, but something is fishy. configure thought that stdatomic.h was present and that gcc does not need any options to enable C11 features, but GCC 4.8 needs -std=gnu11 for C11 features. I wonder if the compiler used for configure and make were different.
I built main successfully with an Ubuntu 18.04 image and GCC 4.8. There is this warning after running configure, but otherwise it builds fine:
configure: Your compiler or platform does have a working C11 stdatomic.h. A future version of Python may require stdatomic.h.
According to PEP-7:
However, CPython now requires
#include <stdatomic.h>
(an optional C11 feature) or MSVC. (Mimalloc can use C++ atomics, C11 atomics, or MSVC atomics. And pyatomic.h requires C11 atomics, MSVC atomics, or GCC atomics. The intersection is C11 or MSVC.)This means CPython can't compile with GCC 4.8, as C11 atomics were added in GCC 4.9. See this buildbot failure for example. Granted, GCC 4.9 is very old and we can probably drop it, but I don't know how other compilers are affected.
The text was updated successfully, but these errors were encountered: