Visitar URL original
bpo-46816: Remove declarations for non-__STDC__ compilers by arhadthedev · Pull Request #31466 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20221223152519/https://github.com/python/cpython/pull/31466
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
Contributor

@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
Contributor Author

arhadthedev commented Feb 21, 2022

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

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

vstinner commented Feb 25, 2022

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 Mar 7, 2022
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