-
-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
cpython/abstract.h not compatible with C90 #83796
Comments
Some inline functions use mixed declarations and code. These end up visible in third-party code that includes Python.h, which might not be using a C99 compiler. Example: In file included from /Users/peter/python-builds/3.9/include/python3.9/abstract.h:843, |
PEP-7 says that this is allowed: Python versions greater than or equal to 3.6 use C89 with several select C99 features:
So I don't think these changes should be accepted. |
That's fair for code internal to CPython itself, but these are header files included by third-party code that is embedding Python, so a bit more flexibility and adaptability would be welcome there. |
I'd suggest mentioning this on python-dev, if you want to change the policy. |
C99 is not disallowed in headers. |
I think we should distinguish minimal supported C standard for compiling CPython itself and for compiling extensions. We can use all C99 features supported by main compilers in the code of CPython, but C99 is not even compatible with C++, and it may be not compatible with extensions written in other languages (D, Rust, Go, etc), so I think we should use more restricted version in headers. |
3.9.0a5 fixes my original issue. Thanks. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: