package/time: fix build with newer gcc

Fixes:
https://autobuild.buildroot.net/results/2d4/2d440a31fc49366d77289f1d21080e1861c6ee21/

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Signed-off-by: Julien Olivain <ju.o@free.fr>
(cherry picked from commit 08a638d49f)
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
This commit is contained in:
Bernd Kuhls
2025-11-22 13:54:42 +01:00
committed by Thomas Perale
parent dd1b0c2aaf
commit 105d8f9f2e

View File

@@ -0,0 +1,35 @@
From 218cd7ce34b6dbc86c80f1c781639ea7661d1252 Mon Sep 17 00:00:00 2001
From: Marcin Serwin <marcin@serwin.dev>
Date: Thu, 2 Oct 2025 19:30:12 +0200
Subject: [PATCH] time: fix sighandler prototype for C23
In C23 functions with empty argument list in the prototype are treated
as taking no arguments. This means that the `int` argument of the
sighandler must be specified explicitly or the code will fail to
compile due to mismatched function type.
Signed-off-by: Marcin Serwin <marcin@serwin.dev>
Upstream: https://lists.gnu.org/archive/html/bug-time/2025-10/msg00000.html
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
src/time.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/time.c b/src/time.c
index 7b401bc..88287dd 100644
--- a/src/time.c
+++ b/src/time.c
@@ -77,7 +77,7 @@ enum
/* A Pointer to a signal handler. */
-typedef RETSIGTYPE (*sighandler) ();
+typedef RETSIGTYPE (*sighandler) (int);
/* msec = milliseconds = 1/1,000 (1*10e-3) second.
usec = microseconds = 1/1,000,000 (1*10e-6) second. */
--
2.47.3