Skip to contentSkip to conversation

package/vde2: fix build w/ gcc-15

PATCH Applied Peter Korsgaard 2 participants 2 messages Aug 28, 2025 – Aug 29, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/vde2: fix build w/ gcc-15

The vde2 source code uses empty argument function pointer prototypes like:

typedef ssize_t (* ssize_fun)();
extern ssize_fun vdehist_vderead;

In C17 and earlier, such prototypes means unknown number of arguments, whereas with C23 it means no arguments, leading to build failures:

libvdehist.c:39:27: error: initialization of 'ssize_fun' {aka 'long int
(*)(void)'} from incompatible pointer type 'ssize_t (*)(int, void *, size_t)' {aka 'long int (*)(int, void *, long unsigned int)'} [-Wincompatible-pointer-types]

Workaround it using -std=gnu99. Vde2 is provided both as a host and target package, so do this unconditionally for both.

---
 package/vde2/vde2.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/vde2/vde2.mk +5 -0
index ab4c32143d..7c7fbfca9c 100644
@@ -38,5 +38,10 @@ HOST_VDE2_CONF_OPTS = \
 	--disable-profile \
 	--enable-tuntap
 
+# C23 changes meaning of empty argument prototypes like int (*)()
+# causing build failures, so force gnu99
+VDE2_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
+HOST_VDE2_CONF_ENV = CFLAGS="$(HOST_CFLAGS) -std=gnu99"
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
Signature · 6 lines
2.39.5

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 15 lines · Peter Korsgaard

The vde2 source code uses empty argument function pointer prototypes like:

typedef ssize_t (* ssize_fun)();
extern ssize_fun vdehist_vderead;

In C17 and earlier, such prototypes means unknown number of arguments, whereas with C23 it means no arguments, leading to build failures:

libvdehist.c:39:27: error: initialization of 'ssize_fun' {aka 'long int
(*)(void)'} from incompatible pointer type 'ssize_t (*)(int, void *, size_t)' {aka 'long int (*)(int, void *, long unsigned int)'} [-Wincompatible-pointer-types]

Quoted 4 lines

Workaround it using -std=gnu99. Vde2 is provided both as a host and target package, so do this unconditionally for both.

Applied to master, thanks.

Regards,
Arnout

Quoted 9 lines
---
  package/vde2/vde2.mk | 5 +++++
  1 file changed, 5 insertions(+)
package/vde2/vde2.mk +0 -0
index ab4c32143d..7c7fbfca9c 100644

package/vde2/vde2.mk HOST_VDE2_CONF_OPTS = \ · line 47

Quoted 10 lines
package/vde2/vde2.mk +5 -0
@@ -38,5 +38,10 @@ HOST_VDE2_CONF_OPTS = \
  	--disable-profile \
  	--enable-tuntap
 
+# C23 changes meaning of empty argument prototypes like int (*)()
+# causing build failures, so force gnu99
+VDE2_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
+HOST_VDE2_CONF_ENV = CFLAGS="$(HOST_CFLAGS) -std=gnu99"
+
  $(eval $(autotools-package))
  $(eval $(host-autotools-package))

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot