From 7ed636069fbdc9942bcd637f6f902c13415a9910 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Fri, 29 Aug 2025 17:34:33 +0200 Subject: [PATCH] package/libgsm: fix build failure with GCC 15.x Fixes: http://autobuild.buildroot.net/results/95f0ff842e4fddcf9d2ffaeb7ddbb9abeb821319/ There is no proper upstream project with a Git repo or mailing list, so we just sent the patch by e-mail to the project maintainer. Signed-off-by: Thomas Petazzoni Signed-off-by: Peter Korsgaard --- .../0002-Fix-signal-handler-prototype.patch | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 package/libgsm/0002-Fix-signal-handler-prototype.patch diff --git a/package/libgsm/0002-Fix-signal-handler-prototype.patch b/package/libgsm/0002-Fix-signal-handler-prototype.patch new file mode 100644 index 0000000000..c28cf584a1 --- /dev/null +++ b/package/libgsm/0002-Fix-signal-handler-prototype.patch @@ -0,0 +1,61 @@ +From 7ffab0a5028f0bfcb864c2387f41b8d4eb33fb8e Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Fri, 29 Aug 2025 17:27:55 +0200 +Subject: [PATCH] Fix signal handler prototype +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Recent versions of gcc, starting from gcc 15.x, are more picky about +function prototypes, and that cause the following issue: + +usr/include/signal.h:93:23: note: expected ‘__sighandler_t’ {aka ‘void (*)(int)’} but argument is of type ‘void (*)(void)’ + +ultimately causing a build failure. + +This patch fixes that by ensuring the signal handler has the right +prototype. The onintr() function is not only used as a signal handler, +but also on memory allocation failure, in which case a dummy value of +0 is passed as argument, since anyway this value isn't used by +onintr(). + +Upstream: sent by e-mail to Jutta Degener +Signed-off-by: Thomas Petazzoni +--- + src/toast.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/toast.c b/src/toast.c +index 05cd0b3..70a14ba 100644 +--- a/src/toast.c ++++ b/src/toast.c +@@ -211,7 +211,7 @@ static char * suffix P2((name, suf), char *name, char * suf) + } + + +-static void catch_signals P1((fun), SIGHANDLER_T (*fun) ()) ++static void catch_signals P1((fun), SIGHANDLER_T (*fun) (int)) + { + #ifdef SIGHUP + signal( SIGHUP, fun ); +@@ -230,7 +230,7 @@ static void catch_signals P1((fun), SIGHANDLER_T (*fun) ()) + #endif + } + +-static SIGHANDLER_T onintr P0() ++static SIGHANDLER_T onintr P1((signo), int signo) + { + char * tmp = outname; + +@@ -253,7 +253,7 @@ static char * emalloc P1((len), size_t len) + if (!(s = malloc(len))) { + fprintf(stderr, "%s: failed to malloc %d bytes -- abort\n", + progname, (int)len); +- onintr(); ++ onintr(0); + exit(1); + } + return s; +-- +2.50.1 +