[3.11] gh-93442: Make C++ version of _Py_CAST work with 0/NULL. (GH-93500)#93507
Merged
corona10 merged 1 commit intopython:3.11from Jun 5, 2022
Merged
Conversation
…nGH-93500) Add C++ overloads for _Py_CAST_impl() to handle 0/NULL. This will allow C++ extensions that pass 0 or NULL to macros using _Py_CAST() to continue to compile. Without this, you get an error like: invalid ‘static_cast’ from type ‘int’ to type ‘_object*’ The modern way to use a NULL value in C++ is to use nullptr. However, we want to not break extensions that do things the old way. Co-authored-by: serge-sans-paille (cherry picked from commit 8bcc3fa) Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
|
The following commit authors need to sign the Contributor License Agreement: |
Contributor
Author
|
@nascheme: Status check is done, and it's a failure ❌ . |
Contributor
Author
|
@nascheme: Status check is done, and it's a failure ❌ . |
1 similar comment
Contributor
Author
|
@nascheme: Status check is done, and it's a failure ❌ . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add C++ overloads for _Py_CAST_impl() to handle 0/NULL. This will allow
C++ extensions that pass 0 or NULL to macros using _Py_CAST() to
continue to compile. Without this, you get an error like:
The modern way to use a NULL value in C++ is to use nullptr. However,
we want to not break extensions that do things the old way.
Co-authored-by: serge-sans-paille
(cherry picked from commit 8bcc3fa)
Co-authored-by: Neil Schemenauer nas-github@arctrix.com