Skip to contentSkip to conversation

package/libgsm: fix build failure with GCC 15.x

PATCH In review Thomas Petazzoni via buildroot 2 participants 2 messages Aug 29, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 .../0002-Fix-signal-handler-prototype.patch   | 61 +++++++++++++++++++
 1 file changed, 61 insertions(+)
 create mode 100644 package/libgsm/0002-Fix-signal-handler-prototype.patch
package/libgsm/0002-Fix-signal-handler-prototype.patch new file +61 -0
new file mode 100644
index 0000000000..c28cf584a1
@@ -0,0 +1,61 @@
+From 7ffab0a5028f0bfcb864c2387f41b8d4eb33fb8e Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+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 <[email protected]>
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ 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
+
Signature · 6 lines
2.50.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:

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.

Committed, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot