-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Add extern "C"
around PyTraceMalloc_
functions.
#127772
Conversation
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
How do we feel about backporting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. But please remove the two empty lines to be consistent with other header files.
I don't think this affects 3.12 |
Python 3.12 is also affected, but the code is different. |
Pretty much everything else exported by Python.h has an extern "C" annotation, yet this header appears to be missing one.
No strong opinions from my end. I was able to work around the problem. But I wanted to make sure to fix the issue upstream. |
Pretty much everything else exported by Python.h has an extern "C" annotation, yet this header appears to be missing one. (cherry picked from commit 2cdeb61) Co-authored-by: Peter Hawkins <[email protected]>
Sorry, @hawkinsp and @vstinner, I could not cleanly backport this to
|
GH-127815 is a backport of this pull request to the 3.13 branch. |
|
Pretty much everything else exported by Python.h has an extern "C" annotation, yet this header appears to be missing one. (cherry picked from commit 2cdeb61)
GH-127817 is a backport of this pull request to the 3.12 branch. |
#127815) Add `extern "C"` around `PyTraceMalloc_` functions. (GH-127772) Pretty much everything else exported by Python.h has an extern "C" annotation, yet this header appears to be missing one. (cherry picked from commit 2cdeb61) Co-authored-by: Peter Hawkins <[email protected]>
…127817) Add `extern "C"` around `PyTraceMalloc_` functions. (#127772) Pretty much everything else exported by Python.h has an extern "C" annotation, yet this header appears to be missing one. (cherry picked from commit 2cdeb61) Co-authored-by: Peter Hawkins <[email protected]>
This exposed a latent bug in CPython (python/cpython#127772), but it's probably not a good practice in general to wrap other code's headers with extern guards.
This extern block was recently moved, which exposed a latent bug in CPython (python/cpython#127772), but it's probably not a good practice in general to wrap other code's headers with extern guards.
This extern block was recently moved, which exposed a latent bug in CPython (python/cpython#127772), but it's probably not a good practice in general to wrap other code's headers with extern guards.
This extern block was recently moved, which exposed a latent bug in CPython (python/cpython#127772), but it's probably not a good practice in general to wrap other code's headers with extern guards.
This extern block was recently moved, which exposed a latent bug in CPython (python/cpython#127772), but it's probably not a good practice in general to wrap other code's headers with extern guards.
Pretty much everything else exported by
Python.h
has anextern "C"
annotation, yet this header appears to be missing one.(Noticed because numpy/numpy@7124091 added an
extern "C"
around its include of<Python.h>
, which should have been a no-op but wasn't in all cases.)