PEP 007: Add C99 Flexible Array Member to the required feature list.#1349
PEP 007: Add C99 Flexible Array Member to the required feature list.#1349gpshead wants to merge 1 commit intopython:mainfrom
Conversation
|
So far testing on the PR including the buildbot tests have revealed no compilers that have a problem with this 21 year old syntax. If there were any stick in the mud i'd have expected it to be msvc, but even that seems happy. Allowing this avoids undefined behavior. I'm assuming we shouldn't retroactively declare this for existing releases so I'm just stating 3.9 and beyond. Anyone who needs this fixed to build older versions can locally patch or find a compiler flag to avoid undefined behavior issues with the existing code. |
pitrou
left a comment
There was a problem hiding this comment.
+1. I assume the refleak failures are unrelated?
There is a known leak: https://bugs.python.org/issue40115 |
|
I'm fine with the change, but I would prefer to first merge the PR and wait a few days to ensure that it doesn't break anything. |
|
Given this feature is not compatible with C++ if we adopt it, it'd need to be on internal-only structs and never anything in a public .h file. :/ |
|
C++11 has |
That's a good motivation to make more and more structures opaque :-)
|
vstinner
left a comment
There was a problem hiding this comment.
Sadly, if we put that in a public header file, it would break compilation on C++ (ex: pybind11) :-(
Maybe we should just avoid to use this feature in public header files, only in the C files?
|
I suggest to close this PR for now. It can be reopened once https://bugs.python.org/issue40120 will be resolved. https://bugs.python.org/issue40120 is a complex issue. There is a big concern about C++ compatibility :-( |
|
Thanks Victor A |
|
Seems like closing this has resulted in bpo-40120 going active again 😄 |
|
Closing things does wonders for getting people to care :) |
PEP 007: Add C99 Flexible Array Member to the required feature list.
https://en.wikipedia.org/wiki/Flexible_array_member
Required to fix undefined C behavior.
https://bugs.python.org/issue40120
See also python/cpython#19232 which will use this.