Paul Eggert wrote: > Why is telnetd.h including config.h? Only a top-level C file should > include config.h, and it should so so at the start.
We don't have a rule that config.h should *only* be included at the start of each compilation unit. Packages can and do include <config.h> twice. Therefore config.h needs to be idempotent. [1] I'm applying this fix. Thanks, Collin, for the report. [1] https://lists.gnu.org/archive/html/bug-gnulib/2023-01/msg00207.html 2024-04-24 Bruno Haible <br...@clisp.org> Fix warnings triggered by including <config.h> twice (regr. 2024-04-19). Reported by Collin Funk in <https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00398.html>. * m4/extensions.m4 (gl_USE_SYSTEM_EXTENSIONS): Use AH_VERBATIM instead of AC_DEFINE. diff --git a/m4/extensions.m4 b/m4/extensions.m4 index fae4141358..1fb68956b3 100644 --- a/m4/extensions.m4 +++ b/m4/extensions.m4 @@ -1,5 +1,5 @@ # extensions.m4 -# serial 24 -*- Autoconf -*- +# serial 25 -*- Autoconf -*- dnl Copyright (C) 2003, 2006-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -234,6 +234,11 @@ AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS] dnl On OpenSolaris derivatives, the include files contains a couple of dnl declarations that are only activated with an explicit dnl -D__STDC_WANT_LIB_EXT1__. - AC_DEFINE([__STDC_WANT_LIB_EXT1__], [1], - [Define to enable the declarations of ISO C 23 Annex K types and functions.]) + AH_VERBATIM([USE_ISO_C_23_ANNEX_K_EXTENSIONS], +[/* Define to enable the declarations of ISO C 23 Annex K types and functions. */ +#if !(defined __STDC_WANT_LIB_EXT1__ && __STDC_WANT_LIB_EXT1__) +#undef/**/__STDC_WANT_LIB_EXT1__ +#define __STDC_WANT_LIB_EXT1__ 1 +#endif +]) ])