diff mbox series

[iproute2] bridge/vlan.c: fix build with gcc 14 on musl systems

Message ID 20240510142346.1508152-1-gabifalk@gmx.com (mailing list archive)
State Superseded
Delegated to: Stephen Hemminger
Headers show
Series [iproute2] bridge/vlan.c: fix build with gcc 14 on musl systems | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Gabi Falk May 10, 2024, 2:23 p.m. UTC
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 *

Link: https://bugs.gentoo.org/922622
Signed-off-by: Gabi Falk <gabifalk@gmx.com>
---
 bridge/vlan.c | 1 +
 1 file changed, 1 insertion(+)

--
gabi
diff mbox series

Patch

diff --git a/bridge/vlan.c b/bridge/vlan.c
index 5352eb24..0a7e6c45 100644
--- a/bridge/vlan.c
+++ b/bridge/vlan.c
@@ -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>