Skip to content

Commit

Permalink
Disable use of undefined DEF_WEAK macro in strptime.c
Browse files Browse the repository at this point in the history
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.

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é <berrange@redhat.com>
  • Loading branch information
berrange committed Oct 2, 2024
1 parent d5a2c9c commit 636cf34
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sdk/tlibc/time/strptime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 636cf34

Please sign in to comment.