Skip to content

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

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

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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@markshannon
Copy link
Member

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.

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.

4 participants