GeezerVison is showing github.com — [3.15] gh-140550: Fix PyABIInfo_VAR macro: avoid ";" by vstinner · Pull Request #157494 · python/cpython
Conversation
vstinner
commented
Sep 14, 2026
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Remove ";" from PyABIInfo_VAR macro definition, since "PyABIInfo_VAR(abi_info);" added two ";;" which is illegal in C++03.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Remove ";" from PyABIInfo_VAR macro definition, since
"PyABIInfo_VAR(abi_info);" added two ";;" which is illegal in C++03.
|
@encukou: I found this bug while enabling limited C API tests on Free Threading in test_cppext for PR gh-157493. IMO we should fix this issue in Python 3.15.0. Otherwise, developers may start writing extensions as PyABIInfo_VAR(abi_info) (without ;) which is currently accepted.
I checked the documentation: PyABIInfo_VAR is always used as PyABIInfo_VAR(abi_info); (with ;).
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I agree. Thanks for the catch!
It's @hugovk's call though. For context:
With the fix, existing extension modules will work, but some existing ones might fail to compile until they get a small source fix.
All docs show the “correct” way to use PyABIInfo_VAR, but, projects that compile with strict C++03 compliance settings might have adjusted and will now need adjusting back.
IMO, for C-wielding early adopters, a NEWS entry is enough.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Yes, let's have this fixed for 3.15.0, please add the NEWS entry.
Should this go into main first?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Yes, let's have this fixed for 3.15.0, please add the NEWS entry.
I added a NEWS entry.
Should this go into main first?
I extracted the PyABIInfo_VAR macro fix from my larger PR gh-157493. The main change is under review. (I just fixed test_cppext when using clang.)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Should this go into main first?
IMO it should, to keep the change & NEWS together, and make it easier to revert if there's some unforeseen weirdness. I sent #157539.
(If you think keeping this in the bigger change is better I won't object, but then add the NEWS entry there.)
|
vstinner reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks both, both merged!
|
vstinner reacted with hooray emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
ericsnowcurrently
Awaiting requested review from ericsnowcurrently
ericsnowcurrently is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|