package/sdl: fix build with GCC 15.x with X.org support enabled

When building:

 BR2_arm=y
 BR2_cortex_a9=y
 BR2_ARM_ENABLE_VFP=y
 BR2_TOOLCHAIN_EXTERNAL=y
 BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
 BR2_INIT_NONE=y
 BR2_SYSTEM_BIN_SH_NONE=y
 # BR2_PACKAGE_BUSYBOX is not set
 BR2_PACKAGE_SDL=y
 BR2_PACKAGE_SDL_X11=y
 BR2_PACKAGE_XORG7=y
 # BR2_TARGET_ROOTFS_TAR is not set

the build fails with:

./src/video/Xext/Xv/Xv.c:78:5: error: initialization of ‘int (*)(Display *, XEvent *, xEvent *)’ {aka ‘int (*)(Display *, XEvent *, struct _xEvent *)’} from incompatible pointer type ‘int (*)(void)’ [-Wincompatible-pointer-types]

and a number of similar errors in the X.org code.

We fix this by backporting an upstream commit.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
This commit is contained in:
Thomas Petazzoni
2025-08-23 19:05:44 +02:00
committed by Romain Naour
parent da3996a39d
commit 7acaff2d9b

View File

@@ -0,0 +1,66 @@
From 6fb5aadafc9d99c25fb4f1a37d225d5b79bc92e9 Mon Sep 17 00:00:00 2001
From: orbea <orbea@riseup.net>
Date: Sat, 15 Oct 2022 15:10:48 -0700
Subject: [PATCH] Xext: Fix function declarations without a prototype
This is not supported with the upcoming clang 16.
error: a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a subsequent definition [-Werror,-Wdeprecated-non-prototype]
reference: https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240
Upstream: e738cfffced8a006094d55337d917386582ada47
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
src/video/Xext/XME/xme.c | 2 +-
src/video/Xext/Xinerama/Xinerama.c | 3 ++-
src/video/Xext/Xv/Xv.c | 6 +++---
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/video/Xext/XME/xme.c b/src/video/Xext/XME/xme.c
index 2cead35a..bb8d04d4 100644
--- a/src/video/Xext/XME/xme.c
+++ b/src/video/Xext/XME/xme.c
@@ -206,7 +206,7 @@ static char *xigmisc_extension_name = XIGMISC_PROTOCOL_NAME;
/*
* find_display - locate the display info block
*/
-static int XiGMiscCloseDisplay();
+static int XiGMiscCloseDisplay(Display*, XExtCodes*);
static XExtensionHooks xigmisc_extension_hooks = {
NULL, /* create_gc */
diff --git a/src/video/Xext/Xinerama/Xinerama.c b/src/video/Xext/Xinerama/Xinerama.c
index 4ff42ebf..57f64b9c 100644
--- a/src/video/Xext/Xinerama/Xinerama.c
+++ b/src/video/Xext/Xinerama/Xinerama.c
@@ -50,7 +50,8 @@ static /* const */ char *panoramiX_extension_name = PANORAMIX_PROTOCOL_NAME;
#define PanoramiXSimpleCheckExtension(dpy,i) \
XextSimpleCheckExtension (dpy, i, panoramiX_extension_name)
-static int close_display();
+static int close_display(Display*, XExtCodes*);
+
static /* const */ XExtensionHooks panoramiX_extension_hooks = {
NULL, /* create_gc */
NULL, /* copy_gc */
diff --git a/src/video/Xext/Xv/Xv.c b/src/video/Xext/Xv/Xv.c
index 7147b9e8..c254a1dc 100644
--- a/src/video/Xext/Xv/Xv.c
+++ b/src/video/Xext/Xv/Xv.c
@@ -63,9 +63,9 @@ static char *xv_extension_name = XvName;
#define XvCheckExtension(dpy, i, val) \
XextCheckExtension(dpy, i, xv_extension_name, val)
-static char *xv_error_string();
-static int xv_close_display();
-static Bool xv_wire_to_event();
+static char *xv_error_string(Display*, int, XExtCodes*, char*, int);
+static int xv_close_display(Display*, XExtCodes*);
+static Bool xv_wire_to_event(Display*, XEvent*, xEvent*);
static XExtensionHooks xv_extension_hooks = {
NULL, /* create_gc */
--
2.50.1