diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2023-09-26 13:14:37 +0300 |
---|---|---|
committer | Jia Tan <jiat0218@gmail.com> | 2023-10-31 18:44:59 +0800 |
commit | 7dd57f2f2c8fde93fa42b4dbf6d9860717723b41 (patch) | |
tree | 72e1f5f5c4515d7c243b55b986570fa4181edba6 /cmake/tuklib_progname.cmake | |
parent | Build: Remove Gnulib dependency from tests. (diff) | |
download | xz-7dd57f2f2c8fde93fa42b4dbf6d9860717723b41.tar.xz |
Build: Silence Autoconf warning.
There was a use of AC_COMPILE_IFELSE that didn't use
AC_LANG_SOURCE and Autoconf warned about this. The omission
had been intentional but it turned out that this didn't do
what I thought it would.
Autoconf 2.71 manual gives an impression that AC_LANG_SOURCE
inserts all #defines that have been made with AC_DEFINE so
far (confdefs.h). The idea was that omitting AC_LANG_SOURCE
would mean that only the exact code included in the
AC_COMPILE_IFELSE call would be compiled.
With C programs this is not true: the #defines get added without
AC_LANG_SOURCE too. There seems to be no neat way to avoid this.
Thus, with the C language at least, adding AC_LANG_SOURCE makes
no other difference than silencing a warning from Autoconf. The
generated "configure" remains identical. (Docs of AC_LANG_CONFTEST
say that the #defines have been inserted since Autoconf 2.63b and
that AC_COMPILE_IFELSE uses AC_LANG_CONFTEST. So the behavior is
documented if one also reads the docs of macros that one isn't
calling directly.)
Any extra code, including #defines, can cause problems for
these two tests because these tests must use -Werror.
CC=clang CFLAGS=-Weverything is the most extreme example.
It enables -Wreserved-macro-identifier which warns about
It's possible to write a test file that passes -Weverything but
it becomes impossible when Autoconf inserts confdefs.h.
So this commit adds AC_LANG_SOURCE to silence Autoconf warnings.
A different solution is needed for -Werror tests.
Diffstat (limited to 'cmake/tuklib_progname.cmake')
0 files changed, 0 insertions, 0 deletions