Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable use of undefined DEF_WEAK macro in strptime.c #1058

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

berrange
Copy link

@berrange berrange commented Oct 2, 2024

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

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é <berrange@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant