An interesting warning
hmurray at megapathdsl.net
Mon Nov 30 10:49:55 UTC 2015
It's from Debian wheezy (and decendents like Rasbian)
gcc (Debian 4.7.2-5) 4.7.2
[109/174] Compiling ntpd/ntp_io.c
../ntpd/ntp_io.c: In function âprocess_routing_msgsâ:
../ntpd/ntp_io.c:4629:7: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
That line of code is:
It's the middle term in a for loop.
nh is a pointer, cnt is an int.
NLMSG_OK comes from /usr/include/linux/netlink.h
#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
(nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
(nlh)->nlmsg_len <= (len))
nlmsg_len comes from a struct nlmsghdr:
__u32 nlmsg_len; /* Length of message including header
That part of the header didn't change from wheezy to jessie.
The 3rd term is comparing an unsigned with an int. So the real question is
why the compiler on other systems don't complain.
Is there a clean fix for this, or do we just document it as a glitch in this
These are my opinions. I hate spam.
More information about the devel