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 |
ZeroIntensity
left a comment
There was a problem hiding this comment.
LGTM.
How do we feel about backporting?
vstinner
left a comment
There was a problem hiding this comment.
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 <hawkinsp@cs.stanford.edu>
|
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. |
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 an extern "C" annotation, yet this header appears to be missing one.
Pretty much everything else exported by
Python.hhas 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.)