slirp: Fix build with gcc 9
commit8cabd8778c378802adee7d0c3be4e5b5b5be4bee
authorGreg Kurz <groug@kaod.org>
Fri, 1 Mar 2019 09:39:18 +0000 (1 10:39 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Wed, 6 Mar 2019 22:20:35 +0000 (6 23:20 +0100)
tree3036456214d6e1e53ae541150e9a380944e86685
parent32694e98b8d7a246345448a8f707d2e11d6c65e2
slirp: Fix build with gcc 9

Build fails with gcc 9:

  CC      slirp/ndp_table.o
slirp/ndp_table.c: In function ‘ndp_table_add’:
slirp/ndp_table.c:31:23: error: taking address of packed member of ‘struct ndpentry’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
   31 |         if (in6_equal(&ndp_table->table[i].ip_addr, &ip_addr)) {
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
slirp/ndp_table.c: In function ‘ndp_table_search’:
slirp/ndp_table.c:75:23: error: taking address of packed member of ‘struct ndpentry’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
   75 |         if (in6_equal(&ndp_table->table[i].ip_addr, &ip_addr)) {
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

The ndpentry structure isn't used to model on-the-wire data or anything
else that would care for the struct layout. It doesn't need to be packed
actually. Just drop SLIRP_PACKED.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <155143315831.102868.17515265400523392682.stgit@bahia.lan>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
slirp/slirp.h