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

Fix WebP dealloc method definitions #6763

Merged
merged 1 commit into from Nov 29, 2022
Merged

Conversation

Yay295
Copy link
Contributor

@Yay295 Yay295 commented Nov 27, 2022

This fixes

  src/_webp.c:494:5: warning: cast between incompatible function types from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} to ‘void (*)(PyObject *)’ {aka ‘void (*)(struct _object *)’} [-Wcast-function-type]
    494 |     (destructor)_anim_encoder_dealloc, /*tp_dealloc*/
        |     ^

Or to put that a bit more clearly, the function type of the destructor functions should be void (*)(PyObject *) not PyObject * (*)(PyObject *).

@radarhere radarhere added the WebP label Nov 27, 2022
@radarhere radarhere changed the title Fix webp dealloc method definitions Fix WebP dealloc method definitions Nov 27, 2022
@radarhere
Copy link
Member

I'm having trouble finding that warning in our CI jobs. Can you find it in one of them and provide a link? If not, what environment are you on?

@Yay295
Copy link
Contributor Author

Yay295 commented Nov 28, 2022

Just running locally. I added -Wall -Wextra to my makefile.

@radarhere
Copy link
Member

radarhere commented Nov 28, 2022

Ok, running that on Linux generates the warning - https://github.com/radarhere/Pillow/actions/runs/3561838551/jobs/5983089664#step:7:2329

And your change here removes it.

@radarhere radarhere merged commit 0ec32a3 into python-pillow:main Nov 29, 2022
@Yay295 Yay295 deleted the patch-1 branch November 29, 2022 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants