mirror of
https://github.com/SELinuxProject/selinux
synced 2025-02-04 11:51:59 +00:00
8647a6c621
When building libselinux with gcc and many warning flags, the build fails with the following errors: selinux_restorecon.c: In function ‘selinux_restorecon’: selinux_restorecon.c:784:36: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] if (!flags.ignore_digest && size == fc_digest_len && ^~ selabel_digest.c: In function ‘main’: selabel_digest.c:162:16: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] for (i = 0; i < digest_len; i++) ^ selabel_digest.c:173:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] for (i = 0; i < num_specfiles; i++) { ^ clang reports the precise type information of the variables: selinux_restorecon.c:784:36: error: comparison of integers of different signs: 'ssize_t' (aka 'long') and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare] if (!flags.ignore_digest && size == fc_digest_len && ~~~~ ^ ~~~~~~~~~~~~~ selabel_digest.c:162:16: error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare] for (i = 0; i < digest_len; i++) ~ ^ ~~~~~~~~~~ selabel_digest.c:173:17: error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare] for (i = 0; i < num_specfiles; i++) { ~ ^ ~~~~~~~~~~~~~ Silent the warnings by using size_t where appropriate. Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org> |
||
---|---|---|
.. | ||
include | ||
man | ||
src | ||
utils | ||
ChangeLog | ||
LICENSE | ||
Makefile | ||
VERSION |