[PATCH] bltin: fix timescmd with C23
Sam James <[email protected]> Sun, 17 Nov 2024 02:30:17 +0000
| Newsgroups | org.kernel.vger.dash |
|---|---|
| Message-ID | <9f2a8ab063e595188df3fe0546484e5a8156318a.1731810617.git.sam@gentoo.org> |
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.
---
src/bltin/times.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bltin/times.c b/src/bltin/times.c
index 1166a68..252b084 100644
--- 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