Fix -Wformat error in TiffDecode#5305
Merged
radarhere merged 2 commits intopython-pillow:masterfrom Mar 11, 2021
Merged
Conversation
src/libImaging/TiffDecode.c: In function ‘_tiffReadProc’:
src/libImaging/TiffDecode.c:59:58: error: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘toff_t’ {aka ‘long unsigned int’} [-Werror=format=]
src/libImaging/TiffDecode.c:59:67: error: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘toff_t’ {aka ‘long unsigned int’} [-Werror=format=]
Member
|
Building normally, I find that there is currently a
With your change, it becomes
|
radarhere
reviewed
Mar 4, 2021
Contributor
Author
|
Hmm, interesting. I suspect there's a disparity in what underlying type these are being mapped to on your system vs mine - IIRC there are special format specifiers or macros for this case, but failing that it might make sense to explicitly cast to a different type like is being done above. |
Contributor
Author
|
I tried to reply by email but GitHub apparently dropped it. Oh well. |
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.
When building under an environment with -Werror=format, TiffDecode.c no longer builds: