From ff7ced843750bd57073d5c74b8da99cc49d41cef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Tue, 1 Oct 2024 18:53:17 +0100 Subject: [PATCH] Disable use of undefined DEF_WEAK macro in strptime.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The strptime.c code invokes, what is presumably an undefined macro called, DEF_WEAK. The compiler can't resolve this to a function, so being traditional C, it invents a function taking arbitrary args and returning an int. GCC 9.5.0 used in the reproducible build warns about this problem but sdk/Makefile.source is throwing stderr from the tlibc build by sending it all to /dev/null, so the warning is never seen. time/strptime.c:92:1: warning: data definition has no type or storage class 92 | DEF_WEAK(strptime); | ^~~~~~~~ time/strptime.c:92:1: warning: type defaults to 'int' in declaration of 'DEF_WEAK' [-Wimplicit-int] time/strptime.c:92:1: warning: parameter names (without types) in function declaration New GCC 14 has turned this warning into a fatal error, such that this bug breaks the build outside of the NixOS envirnoment. The other use of DEF_WEAK in tlibc/time/localtime.c was surrounded by '#if 0', so do the same in strptime.c Signed-off-by: Daniel P. Berrangé --- sdk/tlibc/time/strptime.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/tlibc/time/strptime.c b/sdk/tlibc/time/strptime.c index 08023a7cc..9e62adc6b 100644 --- a/sdk/tlibc/time/strptime.c +++ b/sdk/tlibc/time/strptime.c @@ -89,7 +89,9 @@ strptime(const char *buf, const char *fmt, struct tm *tm) { return(_strptime(buf, fmt, tm, 1)); } +#if 0 DEF_WEAK(strptime); +#endif static char * _strptime(const char *buf, const char *fmt, struct tm *tm, int initialize)