[Pkg-acpi-devel] Bug#808015: acpid: FTBFS: libnetlink.c:497:54: error: comparison between signed and unsigned integer expressions

Ted Felix ted at tedfelix.com
Tue Dec 15 15:34:39 UTC 2015


On 12/15/2015 06:00 AM, Chris Lamb wrote:
> acpid fails to build from source in unstable/amd64:
>    libnetlink.c: In function 'addattr_l':
>    libnetlink.c:497:54: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
>      if ((int)NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(len) > maxlen) {
>                                                          ^
>    libnetlink.c: In function 'rta_addattr32':
>    libnetlink.c:527:36: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
>      if (RTA_ALIGN(rta->rta_len) + len > maxlen) {
>                                        ^
>    libnetlink.c: In function 'rta_addattr_l':
>    libnetlink.c:545:47: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
>      if (RTA_ALIGN(rta->rta_len) + RTA_ALIGN(len) > maxlen) {
>                                                   ^

   As it is, it's building fine for me.  I assume I have an older 
rtnetlink.h.

   The common thread here is RTA_ALIGN().  My guess is that it's now 
returning an unsigned.  Adding an (int) to each one should fix it.  E.g.:

     if ((int)RTA_ALIGN(rta->rta_len) + len > maxlen) {

   Give it a try and let me know.  If it works, I'll get it in upstream.

Ted.



More information about the Pkg-acpi-devel mailing list