a90c9fc80a3b1dbd15ac1191ee6e6ec935df50e5
[openwrt/openwrt.git] /
1 From 53a89bfd86fff1a00cc77cabb8457a03eaa3bc7d Mon Sep 17 00:00:00 2001
2 From: Gabi Falk <gabifalk@gmx.com>
3 Date: Fri, 10 May 2024 14:36:12 +0000
4 Subject: [PATCH] bridge/vlan.c: bridge/vlan.c: fix build with gcc 14 on musl
5 systems
6
7 On glibc based systems the definition of 'struct timeval' is pulled in
8 with inclusion of <stdlib.h> header, but on musl based systems it
9 doesn't work this way. Missing definition triggers an
10 incompatible-pointer-types error with gcc 14 (warning on previous
11 versions of gcc):
12
13 ../include/json_print.h:80:30: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
14 80 | _PRINT_FUNC(tv, const struct timeval *)
15 | ^~~~~~~
16 ../include/json_print.h:50:37: note: in definition of macro '_PRINT_FUNC'
17 50 | type value); \
18 | ^~~~
19 ../include/json_print.h:80:30: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
20 80 | _PRINT_FUNC(tv, const struct timeval *)
21 | ^~~~~~~
22 ../include/json_print.h:55:45: note: in definition of macro '_PRINT_FUNC'
23 55 | type value) \
24 | ^~~~
25 ../include/json_print.h: In function 'print_tv':
26 ../include/json_print.h:58:48: error: passing argument 5 of 'print_color_tv' from incompatible pointer type [-Wincompatible-pointer-types]
27 58 | value); \
28 | ^~~~~
29 | |
30 | const struct timeval *
31
32 Signed-off-by: Gabi Falk <gabifalk@gmx.com>
33 Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
34 ---
35 bridge/vlan.c | 1 +
36 bridge/vni.c | 1 +
37 vdpa/vdpa.c | 1 +
38 3 files changed, 3 insertions(+)
39
40 --- a/bridge/vlan.c
41 +++ b/bridge/vlan.c
42 @@ -4,6 +4,7 @@
43 #include <unistd.h>
44 #include <fcntl.h>
45 #include <sys/socket.h>
46 +#include <sys/time.h>
47 #include <net/if.h>
48 #include <netinet/in.h>
49 #include <linux/if_bridge.h>
50 --- a/bridge/vni.c
51 +++ b/bridge/vni.c
52 @@ -10,6 +10,7 @@
53 #include <string.h>
54 #include <fcntl.h>
55 #include <sys/socket.h>
56 +#include <sys/time.h>
57 #include <net/if.h>
58 #include <netinet/in.h>
59 #include <linux/if_link.h>
60 --- a/vdpa/vdpa.c
61 +++ b/vdpa/vdpa.c
62 @@ -3,6 +3,7 @@
63 #include <stdio.h>
64 #include <getopt.h>
65 #include <errno.h>
66 +#include <sys/time.h>
67 #include <linux/genetlink.h>
68 #include <linux/if_ether.h>
69 #include <linux/vdpa.h>