|
From: | Stephan Bergmann |
Subject: | Fallout from _AC_UNDECLARED_WARNING in autoconf 2.70beta |
Date: | Thu, 5 Nov 2020 16:38:01 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 |
That configure.ac checks whether one specific GCC -Wno-missing-field-initializers flag is supported (l. 606), based on that one check optimistically goes ahead and adds a whole bunch of -Wno-... flags to CFLAGS, and only then (l. 661) happens to call _AC_UNDECLARED_WARNING (via gnupg_REPLACE_TTYNAME_R -> AC_CHECK_DECLS_ONCE -> _AC_CHECK_DECL_BODY) for the first time.
If that configure is invoked with CC=clang supporting -Wno-missing-field-initializers but not supporting e.g. -Wno-format-truncation (which is among the bunch of flags optimistically added to CFLAGS), that was not much of an issue in the past; invocations of clang kept emitting noisy but harmless
warning: unknown warning option '-Wno-format-truncation' [-Wunknown-warning-option]
lines. But now, _AC_CHECK_DECL_BODY fails hard with
configure:21628: checking how clang reports undeclared, standard C functions configure:21645: clang -c -g -O2 -Wall -Wcast-align -Wshadow -Wstrict-prototypes -Wno-format-y2k -Wno-missing-field-initializers -Wno-sign-compare -Wno-format-zero-length -Wno-format-truncation -Wno-sizeof-pointer-div conftest.c >&5 warning: unknown warning option '-Wno-format-truncation' [-Wunknown-warning-option] conftest.c:51:8: warning: implicitly declaring library function 'strchr' with type 'char *(const char *, int)' [-Wimplicit-function-declaration] (void) strchr; ^ conftest.c:51:8: note: include the header <string.h> or explicitly provide a declaration for 'strchr' 2 warnings generated. configure:21645: $? = 0 configure:21675: clang -c -g -O2 -Wall -Wcast-align -Wshadow -Wstrict-prototypes -Wno-format-y2k -Wno-missing-field-initializers -Wno-sign-compare -Wno-format-zero-length -Wno-format-truncation -Wno-sizeof-pointer-div conftest.c >&5 warning: unknown warning option '-Wno-format-truncation' [-Wunknown-warning-option] 1 warning generated. configure:21675: $? = 0 configure:21679: error: in `/home/sbergman/git.gnupg.org/gpgme': configure:21681: error: cannot detect from compiler exit status or warnings
One workaround is to move the gnupg_REPLACE_TTYNAME_R before the -Wno-missing-field-initializers etc. block in configure.ac. And maybe there would be a dedicated macro that can be called early to set up _AC_UNDECLARED_WARNING prior to modifying CFLAGS?
[Prev in Thread] | Current Thread | [Next in Thread] |