gentoo-ebuilds/app-shells/dash/files/dash-0.5.12-c23-lto.patch
Sam James b79ff94a27
app-shells/dash: fix C23 compat
Signed-off-by: Sam James <sam@gentoo.org>
2024-11-17 02:32:13 +00:00

36 lines
1.2 KiB
Diff
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

https://lore.kernel.org/dash/9f2a8ab063e595188df3fe0546484e5a8156318a.1731810617.git.sam@gentoo.org/
From 9f2a8ab063e595188df3fe0546484e5a8156318a Mon Sep 17 00:00:00 2001
Message-ID: <9f2a8ab063e595188df3fe0546484e5a8156318a.1731810632.git.sam@gentoo.org>
From: Sam James <sam@gentoo.org>
Date: Sun, 17 Nov 2024 02:28:07 +0000
Subject: [PATCH] bltin: fix timescmd with C23
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
With C23 and LTO, we get the following warning (or error if promoted to such):
```
src/builtins.c:28:5: error: type of timescmd does not match original declaration [-Werror=lto-type-mismatch]
28 | int timescmd(int, char **);
| ^
src/bltin/times.c:15:5: note: type mismatch in parameter 1
src/bltin/times.c:15:5: note: type void should match type int
```
Make the two consistent. This didn't show up before because pre-C23
had unprototyped functions.
--- a/src/bltin/times.c
+++ b/src/bltin/times.c
@@ -12,7 +12,7 @@
#endif
#include "system.h"
-int timescmd() {
+int timescmd(int argc, char *argv[]) {
struct tms buf;
long int clk_tck = sysconf(_SC_CLK_TCK);
int mutime, mstime, mcutime, mcstime;
--
2.47.0