+2025-04-18 Bruno Haible <bruno@clisp.org>
+
+ Pacify gcc -Wtrailing-whitespace warnings across all of config.h.
+ * m4/gnulib-common.m4 (gl_COMMON_BODY): Use AH_TOP and AH_BOTTOM to
+ disable -Wtrailing-whitespace warnings across all of config.h.
+ * m4/iconv.m4: Revert last change.
+
2025-04-18 Bruno Haible <bruno@clisp.org>
unitypes-h: Avoid risky coding pattern.
# gnulib-common.m4
-# serial 108
+# serial 109
dnl Copyright (C) 2007-2025 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AH_VERBATIM([0witness],
[/* Witness that <config.h> has been included. */
#define _GL_CONFIG_H_INCLUDED 1
+])
+ dnl Avoid warnings from gcc -Wtrailing-whitespace.
+ dnl This is a temporary workaround until Autoconf fixes it.
+ dnl Test case:
+ dnl empty1=; empty2=; AC_DEFINE_UNQUOTED([FOO], [$empty1$empty2], [...])
+ dnl should produce "#define FOO /**/", not "#define FOO ".
+ AH_TOP([#if defined __GNUC__ && __GNUC__ >= 15 && !defined __clang__
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wtrailing-whitespace"
+#endif
+])
+ AH_BOTTOM([#if defined __GNUC__ && __GNUC__ >= 15 && !defined __clang__
+# pragma GCC diagnostic pop
+#endif
])
AH_VERBATIM([_GL_GNUC_PREREQ],
[/* True if the compiler says it groks GNU C version MAJOR.MINOR.
# iconv.m4
-# serial 29
+# serial 30
dnl Copyright (C) 2000-2002, 2007-2014, 2016-2025 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
LIBS="$LIBS $LIBICONV"
fi
am_cv_func_iconv_works=no
- for ac_iconv_const in '/*empty*/' 'const'; do
+ for ac_iconv_const in '' 'const'; do
AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[
gl_cv_iconv_nonconst=yes
fi
if test $gl_cv_iconv_nonconst = yes; then
- iconv_arg1="/*empty*/"
+ iconv_arg1=""
else
iconv_arg1="const"
fi
dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
m4_ifdef([gl_ICONV_H_DEFAULTS],
[AC_REQUIRE([gl_ICONV_H_DEFAULTS])
- ICONV_CONST=$iconv_arg1])
+ if test $gl_cv_iconv_nonconst != yes; then
+ ICONV_CONST="const"
+ fi
+ ])
dnl A summary result, for those packages which want to print a summary at the
dnl end of the configuration.