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

bpo-46816: Remove declarations for non-__STDC__ compilers #31466

Merged
merged 1 commit into from Feb 25, 2022

Conversation

arhadthedev
Copy link
Member

@arhadthedev arhadthedev commented Feb 21, 2022

Currently, Python code contains two places where presence of STDC is checked:

  • Include/internal/pycore_pymath.h:12
  • Python/errors.c:13

These checks are used to add extern functions missing in non-standard versions of math.h.

However, after Python switched to C99, there is a guarantee that every compiler conforms to ISO C so checks of STDC have no sense anymore.

Note, that:

  • errors.c check was added by 53e8d44 on 9 Mar 1995
  • pycore_pymath.h check was initially added into Objects/floatobject.c by eddc144 on 20 Nov 2003 then moved to pycore_pymath by 53876d9.

https://bugs.python.org/issue46816

After Python switched to C99, there is a guarantee that every compiler
conforms to ISO C so checks of __STDC__ have no sense.
@arhadthedev
Copy link
Member Author

The changes are not visible to users so no NEWS entry is required.

@vstinner vstinner merged commit 4060111 into python:main Feb 25, 2022
@vstinner
Copy link
Member

I merged your PR, thanks.

asvetlov pushed a commit that referenced this pull request Feb 26, 2022
After Python switched to C11, there is a guarantee that every compiler
conforms to ISO C so checks of __STDC__ have no sense.
@arhadthedev arhadthedev deleted the always-stdc branch March 7, 2022 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants