On 07. 02. 22 18:09, Victor Stinner wrote:
Hi,
I made a change to require C99 <math.h> "NAN" constant and I'm was asked to update the PEP 7 to clarify the C subset is needed to build Python 3.11.
Python 3.6 requires a subset of the C99 standard to build defined by the PEP 7: https://www.python.org/dev/peps/pep-0007/
I modified Python 3.11 to require more C99 features of the <math.h> header:
* bpo-45440: copysign(), hypot(), isfinite(), isinf(), isnan(), round() * bpo-46640: NAN
After my NAN change (bpo-46640), Petr Viktorin asked me to update the PEP 7. I proposed a change to simply say that "Python 3.11 and newer versions use C99": https://github.com/python/peps/pull/2309
I would prefer to not have to give an exhaustive list of C99 features used by CPython, since it's unclear to me what belongs to C99 or to ISO C89. As I wrote before, Python already uses C99 features since Python 3.6.
On my PEP PR, Guido van Rossum asked me to escalate the discussion to python-dev, so here I am :-)
In "C99", the number "99" refers to the year 1999, the standard is now 23 years old: https://en.wikipedia.org/wiki/C99
In 2022, C99 is now well supported by C compilers supported by Python: GCC, clang, MSVC.
Does MSVC support all of C99? I haven't found any documentation claiming that... but I'm also not familiar with MSVC. Do we need to support a subset like "C99 except the features that were removed in C11"?