unix: fix GCC 6 warnings
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 23 Feb 2016 18:36:46 +0000 (19:36 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 25 Feb 2016 12:39:32 +0000 (13:39 +0100)
commit7a46992495ea2560696b79aaca616cd18a8f85bd
tree5c64f72b1028d0b95c6ada04e1adacbd1dcd6f23
parent29538b20fb1d9fb0674ab02df988e343431183c8
unix: fix GCC 6 warnings

src/unix/ifnet.c:270:109: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
         (&((struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifp->int_addr))->sin_addr.s_addr, &((struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_addr))->sin_addr.s_addr,
                                                                                                             ^
src/unix/ifnet.c:277:45: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       ifp->int_addr = *(struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_addr);
                                             ^
src/unix/ifnet.c:278:52: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       memcpy(&ifp->ip_addr, &((struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_addr))->sin_addr.s_addr, olsr_cnf->ipsize);
                                                    ^
src/unix/ifnet.c:296:112: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
         (&((struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifp->int_netmask))->sin_addr.s_addr, &((struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_netmask))->sin_addr.s_addr,
                                                                                                                ^
src/unix/ifnet.c:303:48: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       ifp->int_netmask = *(struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_netmask);
                                                ^
src/unix/ifnet.c:332:52: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
         ifp->int_broadaddr = *(struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_broadaddr);
                                                    ^
src/unix/ifnet.c: In function ‘chk_if_up’:
src/unix/ifnet.c:604:44: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       ifs.int_addr = *(struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_addr);
                                            ^
src/unix/ifnet.c:612:45: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
     ifs.int_netmask = *(struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_netmask);
                                             ^
src/unix/ifnet.c:625:49: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
       ifs.int_broadaddr = *(struct sockaddr_in *)ARM_NOWARN_ALIGN(&ifr.ifr_broadaddr);
                                                 ^

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/unix/ifnet.c