]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
bridge/vlan.c: bridge/vlan.c: fix build with gcc 14 on musl systems
authorGabi Falk <gabifalk@gmx.com>
Fri, 10 May 2024 14:36:12 +0000 (14:36 +0000)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 14 May 2024 05:21:38 +0000 (22:21 -0700)
On glibc based systems the definition of 'struct timeval' is pulled in
with inclusion of <stdlib.h> header, but on musl based systems it
doesn't work this way.  Missing definition triggers an
incompatible-pointer-types error with gcc 14 (warning on previous
versions of gcc):

../include/json_print.h:80:30: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
   80 | _PRINT_FUNC(tv, const struct timeval *)
      |                              ^~~~~~~
../include/json_print.h:50:37: note: in definition of macro '_PRINT_FUNC'
   50 |                                     type value);                        \
      |                                     ^~~~
../include/json_print.h:80:30: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
   80 | _PRINT_FUNC(tv, const struct timeval *)
      |                              ^~~~~~~
../include/json_print.h:55:45: note: in definition of macro '_PRINT_FUNC'
   55 |                                             type value)                 \
      |                                             ^~~~
../include/json_print.h: In function 'print_tv':
../include/json_print.h:58:48: error: passing argument 5 of 'print_color_tv' from incompatible pointer type [-Wincompatible-pointer-types]
   58 |                                                value);                  \
      |                                                ^~~~~
      |                                                |
      |                                                const struct timeval *

Signed-off-by: Gabi Falk <gabifalk@gmx.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
bridge/vlan.c
bridge/vni.c
vdpa/vdpa.c

index 5352eb24fb4c4a2c218195e4af8c0d867bf8adb7..0a7e6c45b2be2e900f2a435f91864ed6c8e07144 100644 (file)
@@ -4,6 +4,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/socket.h>
+#include <sys/time.h>
 #include <net/if.h>
 #include <netinet/in.h>
 #include <linux/if_bridge.h>
index a7abe6de5df0c842a57b0b53aecca3f129187636..e1f981fc74b7ed040ffbd744b329d8ec36115984 100644 (file)
@@ -10,6 +10,7 @@
 #include <string.h>
 #include <fcntl.h>
 #include <sys/socket.h>
+#include <sys/time.h>
 #include <net/if.h>
 #include <netinet/in.h>
 #include <linux/if_link.h>
index 6e4a9c110e7574949227cb26f482466143d71d7a..43f878242447cb3afa1973c28881955d4afd15b3 100644 (file)
@@ -3,6 +3,7 @@
 #include <stdio.h>
 #include <getopt.h>
 #include <errno.h>
+#include <sys/time.h>
 #include <linux/genetlink.h>
 #include <linux/if_ether.h>
 #include <linux/vdpa.h>