livetree: Fix a comparison of integers with different signedness#187
Open
ukleinek wants to merge 1 commit into
Open
livetree: Fix a comparison of integers with different signedness#187ukleinek wants to merge 1 commit into
ukleinek wants to merge 1 commit into
Conversation
On some architectures we have:
livetree.c: In function 'fixup_phandles':
livetree.c:1237:54: error: comparison of integer expressions of different signedness: 'long int' and 'unsigned int' [-Werror=sign-compare]
1237 | if (offset < 0 || offset + 4 > p->val.len) {
| ^
cc1: all warnings being treated as errors
make: *** [Makefile:307: livetree.o] Error 1
Fixes: a26ef64 ("Restore phandle references from __fixups__ node")
Closes: dgibson#186
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Contributor
Author
|
BTW, gcc 15.2.0 on x86_64 is fine with the code, gcc 15.2.0 on armhf triggers this warning. I guess the relevant difference is that on x86_64 an unsigned long (64bit) is big enough to hold all values of an unsigned int (32bit), but on armhf (both 32 bit) it isn't. |
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.
On some architectures we have:
Fixes: a26ef64 ("Restore phandle references from fixups node")
Closes: #186