* m4/manywarnings.m4 (gl_MANYWARN_COMPLEMENT):
Use AS_IF when the body contains Autoconf macros that could
conceivably require something.
---
 ChangeLog          |  5 +++++
 m4/manywarnings.m4 | 10 ++++------
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ff1f6abca3..8387b5ed57 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2023-04-23  Paul Eggert  <egg...@cs.ucla.edu>
 
+       manywarnings: use AS_IF
+       * m4/manywarnings.m4 (gl_MANYWARN_COMPLEMENT):
+       Use AS_IF when the body contains Autoconf macros that could
+       conceivably require something.
+
        manywarnings: update C warnings for GCC 13
        Adjust for C programs compiled by GCC 13.
        (A C++ expert still needs to look at manywarnings-c++.m4.)
diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4
index 1d69116ddb..13db996516 100644
--- a/m4/manywarnings.m4
+++ b/m4/manywarnings.m4
@@ -46,8 +46,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)],
   dnl First, check for some issues that only occur when combining multiple
   dnl gcc warning categories.
   AC_REQUIRE([AC_PROG_CC])
-  if test -n "$GCC"; then
-
+  AS_IF([test -n "$GCC"], [
     dnl Check if -Wextra -Werror -Wno-missing-field-initializers is supported
     dnl with the current $CC $CFLAGS $CPPFLAGS.
     AC_CACHE_CHECK([whether -Wno-missing-field-initializers is supported],
@@ -61,7 +60,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)],
        CFLAGS="$gl_save_CFLAGS"
       ])
 
-    if test "$gl_cv_cc_nomfi_supported" = yes; then
+    AS_IF([test "$gl_cv_cc_nomfi_supported" = yes], [
       dnl Now check whether -Wno-missing-field-initializers is needed
       dnl for the { 0, } construct.
       AC_CACHE_CHECK([whether -Wno-missing-field-initializers is needed],
@@ -82,7 +81,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)],
            [gl_cv_cc_nomfi_needed=yes])
          CFLAGS="$gl_save_CFLAGS"
         ])
-    fi
+    ])
 
     dnl Next, check if -Werror -Wuninitialized is useful with the
     dnl user's choice of $CFLAGS; some versions of gcc warn that it
@@ -97,8 +96,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)],
          [gl_cv_cc_uninitialized_supported=no])
        CFLAGS="$gl_save_CFLAGS"
       ])
-
-  fi
+  ])
 
   # List all gcc warning categories.
   # To compare this list to your installed GCC's, run this Bash command:
-- 
2.40.0


Reply via email to