Target value for val has uint32_t type, not uint, adjust used constant.
Cast val to unsigned so that left and right sides of comparision operator do not expose different signed types of same range.
Details
Details
- Reviewers
emaste - Commits
- rG9940ac808de7: elfctl: Fix type errors.
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
This still breaks buildworld on several archs:
/usr/src/usr.bin/elfctl/elfctl.c:258:35: error: use of undeclared identifier 'UINT32_MAX'
else if ((unsigned long)val > UINT32_MAX)
adding stdint.h fixes it
huh, bad timing
Comment Actions
For me, the build worked. Are you worried about gcc?
Ah, yes I see it builds fine with this change, but e.g. 0xffffffff doesn't work on 32-bit with long.