Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libselinux: Fix integer comparison issues when compiling for 32-bit
Trying to compile libselinux for 32-bit produces the following error: selinux_restorecon.c:1194:31: error: comparison of integer expressions of different signedness: ‘__fsword_t’ {aka ‘int’} and ‘unsigned int’ [-Werror=sign-compare] 1194 | if (state.sfsb.f_type == RAMFS_MAGIC || state.sfsb.f_type == TMPFS_MAGIC || | ^~ Since RAMFS_MAGIC = 0x858458f6 == 2240043254, which > 2^31, but < 2^32, cast both as uint32_t for the comparison. Reported-by: Daniel Schepler Signed-off-by: James Carter <[email protected]> Reviewed-by: Christian Göttsche <[email protected]>
- Loading branch information