Skip to content

CPython requires stdatomic.h #118034

@encukou

Description

@encukou

According to PEP-7:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildtopic-C-API

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions