]> Savannah Git Hosting - gnulib.git/commitdiff
Pacify GCC 15’s new -Wtrailing-whitespace option
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 17 Apr 2025 07:22:43 +0000 (00:22 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 17 Apr 2025 07:30:25 +0000 (00:30 -0700)
* m4/builtin-expect.m4 (gl___BUILTIN_EXPECT):
* m4/iconv.m4 (AM_ICONV_LINK, AM_ICONV):
Avoid whitespace at line end in C code.
* modules/unitypes-h (unitypes_restrict):
Likewise, bearing in mind that configure.ac lines will be indented
so such lines containing only '])' should be avoided when they
generate C code.

ChangeLog
m4/builtin-expect.m4
m4/iconv.m4
modules/unitypes-h

index 1ff4dceb238e903ea33f0d026af29dab345586eb..6da050ff2df30c0c5c1b2c5173763be898c171a1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2025-04-17  Paul Eggert  <eggert@cs.ucla.edu>
 
+       Pacify GCC 15’s new -Wtrailing-whitespace option
+       * m4/builtin-expect.m4 (gl___BUILTIN_EXPECT):
+       * m4/iconv.m4 (AM_ICONV_LINK, AM_ICONV):
+       Avoid whitespace at line end in C code.
+       * modules/unitypes-h (unitypes_restrict):
+       Likewise, bearing in mind that configure.ac lines will be indented
+       so such lines containing only '])' should be avoided when they
+       generate C code.
+
        manywarnings: update C warnings for GCC 15
        Adjust for C programs compiled by GCC 15.
        This is merely changes to commentary; no changes to
index 2c2fab4bb62eeff6123f96b9876bdc2d1051ac79..76d3286788affdb2136bdecd1f01fcf252c0cab6 100644 (file)
@@ -1,5 +1,5 @@
 # builtin-expect.m4
-# serial 2
+# serial 3
 dnl Copyright 2016-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,
@@ -48,5 +48,4 @@ AC_DEFUN([gl___BUILTIN_EXPECT],
 #elif HAVE___BUILTIN_EXPECT == 2
 # include <builtins.h>
 #endif
-    ])
-])
+])])
index 9af06c4399b5341fd6ff91ba4456628c4554d7d9..09ab1dc825fa21b49858e5ca2ce56db45991c5cb 100644 (file)
@@ -1,5 +1,5 @@
 # iconv.m4
-# serial 28
+# serial 29
 dnl Copyright (C) 2000-2002, 2007-2014, 2016-2025 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -82,7 +82,7 @@ AC_DEFUN([AM_ICONV_LINK],
         LIBS="$LIBS $LIBICONV"
       fi
       am_cv_func_iconv_works=no
-      for ac_iconv_const in '' 'const'; do
+      for ac_iconv_const in '/*empty*/' 'const'; do
         AC_RUN_IFELSE(
           [AC_LANG_PROGRAM(
              [[
@@ -292,7 +292,7 @@ size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, si
     gl_cv_iconv_nonconst=yes
   fi
   if test $gl_cv_iconv_nonconst = yes; then
-    iconv_arg1=""
+    iconv_arg1="/*empty*/"
   else
     iconv_arg1="const"
   fi
@@ -301,10 +301,7 @@ size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, si
   dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
   m4_ifdef([gl_ICONV_H_DEFAULTS],
     [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
-     if test $gl_cv_iconv_nonconst != yes; then
-       ICONV_CONST="const"
-     fi
-    ])
+     ICONV_CONST=$iconv_arg1])
 
   dnl A summary result, for those packages which want to print a summary at the
   dnl end of the configuration.
index faf0d89b6cb61b3a13d33f17acc384f6e8017fa0..b512947c73eb716d4a423518af1b8806c3507f2a 100644 (file)
@@ -26,8 +26,7 @@ AH_VERBATIM([unitypes_restrict], [
 #  define _UC_RESTRICT restrict
 # else
 #  define _UC_RESTRICT
-# endif
-])
+# endif])
 
 Makefile.am:
 BUILT_SOURCES += $(LIBUNISTRING_UNITYPES_H)