Unverified Commit ed2778e8 authored by Michael Daniels's avatar Michael Daniels Committed by GitHub
Browse files

time: 1.9 -> 1.10 (#510417)

parents 2de4c548 9fe0c5a2
Loading
Loading
Loading
Loading
+3 −11
Original line number Diff line number Diff line
@@ -6,21 +6,13 @@

stdenv.mkDerivation (finalAttrs: {
  pname = "time";
  version = "1.9";
  version = "1.10";

  src = fetchurl {
    url = "mirror://gnu/time/time-${finalAttrs.version}.tar.gz";
    hash = "sha256-+6zwyB5iQp3z4zvaTO44dWYE8Y4B2XczjiMwaj47Uh4=";
    url = "mirror://gnu/time/time-${finalAttrs.version}.tar.xz";
    hash = "sha256-cGv3uERMqeuQN+ntoY4dDrfCMnrn2MLOOkgjxfgMexE=";
  };

  patches = [
    # fixes cross-compilation to riscv64-linux
    ./time-1.9-implicit-func-decl-clang.patch
    # https://lists.gnu.org/archive/html/bug-time/2025-10/msg00000.html
    # fix compilation with gcc15
    ./time-1.9-fix-sighandler-prototype-for-c23.patch
  ];

  outputs = [
    "out"
    "info"
+0 −30
Original line number Diff line number Diff line
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>
---
This fixes the same issue as
<https://lists.gnu.org/archive/html/bug-time/2025-01/msg00000.html> and
<https://lists.gnu.org/archive/html/bug-time/2025-03/msg00000.html> but does not
rely on `sighandler_t` which is a GNU extension.

 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.51.0
+0 −24
Original line number Diff line number Diff line
https://lists.gnu.org/archive/html/bug-time/2022-08/msg00001.html

From c8deae54f92d636878097063b411af9fb5262ad3 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 15 Aug 2022 07:24:24 -0700
Subject: [PATCH] include string.h for memset()

Fixes implicit function declaration warning e.g.

resuse.c:103:3: error: call to undeclared library function 'memset' with type 'void *(void *, int, unsigned long)'

Upstream-Status: Submitted [https://lists.gnu.org/archive/html/bug-time/2022-08/msg00001.html]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/src/resuse.c
+++ b/src/resuse.c
@@ -22,6 +22,7 @@
 */ 
 
 #include "config.h"
+#include <string.h>
 #include <sys/time.h>
 #include <sys/wait.h>
 #include <sys/resource.h>