From 0aeb127f3cfe4abbc9a894c236541467396ed5ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Fri, 4 Oct 2019 16:56:12 +0200 Subject: iron out all extra compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc 9.1 on x86/64 has reported following: attr.c:403:19: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] genl.c:154:24: error: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Werror=sign-compare] genl_mngt.c:157:22: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] msg.c:190:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] msg.c:192:18: error: comparison of integer expressions of different signedness: ‘__u32’ {aka ‘const unsigned int’} and ‘int’ [-Werror=sign-compare] msg.c:361:10: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare] nl.c:428:18: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare] nl.c:602:23: error: comparison of integer expressions of different signedness: ‘__u32’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare] Signed-off-by: Petr Štetiar --- nl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nl.c') diff --git a/nl.c b/nl.c index 2fb866e..2649470 100644 --- a/nl.c +++ b/nl.c @@ -425,7 +425,7 @@ retry: } } - if (iov.iov_len < n || + if (iov.iov_len < (size_t) n || msg.msg_flags & MSG_TRUNC) { /* Provided buffer is not long enough, enlarge it * and try again. */ @@ -599,7 +599,7 @@ continue_reading: else if (hdr->nlmsg_type == NLMSG_ERROR) { struct nlmsgerr *e = nlmsg_data(hdr); - if (hdr->nlmsg_len < nlmsg_msg_size(sizeof(*e))) { + if (hdr->nlmsg_len < (unsigned) nlmsg_msg_size(sizeof(*e))) { /* Truncated error message, the default action * is to stop parsing. The user may overrule * this action by returning NL_SKIP or -- cgit v1.2.1