diff mbox series

bltin: fix timescmd with C23

Message ID 9f2a8ab063e595188df3fe0546484e5a8156318a.1731810617.git.sam@gentoo.org (mailing list archive)
State Under Review
Delegated to: Herbert Xu
Headers show
Series bltin: fix timescmd with C23 | expand

Commit Message

Sam James Nov. 17, 2024, 2:30 a.m. UTC
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 mbox series

Patch

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;