From 7acaff2d9b6abab0d422c608547a26310a64034d Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sat, 23 Aug 2025 19:05:44 +0200 Subject: [PATCH] package/sdl: fix build with GCC 15.x with X.org support enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Romain Naour --- ...ion-declarations-without-a-prototype.patch | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 package/sdl/0003-Xext-Fix-function-declarations-without-a-prototype.patch diff --git a/package/sdl/0003-Xext-Fix-function-declarations-without-a-prototype.patch b/package/sdl/0003-Xext-Fix-function-declarations-without-a-prototype.patch new file mode 100644 index 0000000000..cccc0464bb --- /dev/null +++ b/package/sdl/0003-Xext-Fix-function-declarations-without-a-prototype.patch @@ -0,0 +1,66 @@ +From 6fb5aadafc9d99c25fb4f1a37d225d5b79bc92e9 Mon Sep 17 00:00:00 2001 +From: orbea +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 +--- + 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 +