Skip to content
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

gh-90667: Cast to destructor to fix warnings #91711

Merged
merged 1 commit into from Apr 20, 2022
Merged

Conversation

sweeneyde
Copy link
Member

@sweeneyde sweeneyde commented Apr 19, 2022

#30872 added some compiler warnings

@sweeneyde
Copy link
Member Author

sweeneyde commented Apr 19, 2022

Reading up on it more, this might not be 100% within the C spec.

void * and PyObject * could technically have different sizes.

Copy link
Member

@Fidget-Spinner Fidget-Spinner left a comment

Thanks.

@markshannon
Copy link
Member

markshannon commented Apr 20, 2022

Reading up on it more, this might not be 100% within the C spec.

void * and PyObject * could technically have different sizes.

You cannot cast a function pointer to a normal pointer, or vice versa, but casting one function pointer to another is fine.
It might break strict aliasing, that is irrelevant here.

@markshannon markshannon merged commit d7d7e6c into python:main Apr 20, 2022
12 checks passed
@sweeneyde sweeneyde deleted the cast branch Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants