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

Fixed compilation warnings #7050

Merged
merged 3 commits into from
Mar 31, 2023
Merged

Fixed compilation warnings #7050

merged 3 commits into from
Mar 31, 2023

Conversation

radarhere
Copy link
Member

https://github.com/python-pillow/Pillow/actions/runs/4571913703/jobs/8070643875#step:7:66

src/_imaging.c: In function ‘getink’:
src/_imaging.c:555:44: warning: ‘tupleSize’ may be used uninitialized in this function [-Wmaybe-uninitialized]
555 | if (tupleSize != 1 && tupleSize != 2) {
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~

This variable was added in #7010.

@radarhere
Copy link
Member Author

radarhere commented Mar 31, 2023

Compiling on my macOS machine, I see

src/libImaging/Quant.c:344:17: warning: variable 'nLeft' set but not used [-Wunused-but-set-variable]
int nRight, nLeft;
^
1 warning generated.

This is because nLeft is only used if NO_OUTPUT is defined. I've added a commit to also only set nLeft if NO_OUTPUT is defined.

@radarhere radarhere changed the title Fix warning that variable may be uninitialized Fixed compilation warnings Mar 31, 2023
@hugovk hugovk added automerge Automatically merge PRs that are ready Cleanup labels Mar 31, 2023
@mergify mergify bot merged commit b441916 into python-pillow:main Mar 31, 2023
@radarhere radarhere deleted the warning branch March 31, 2023 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PRs that are ready Cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants