Paul Eggert wrote: > Sync from bleeding-edge Autoconf. All uses changed.
When using - current gnulib, - Autoconf 2.72, - a configure.ac file that invokes AC_FUNC_MALLOC, I see the following change in the generated configure file: | gnu* | *-musl* | midipix* | midnightbsd* \ | hpux* | solaris* | cygwin* | mingw* | windows* | msys* ) ac_cv_func_malloc_0_nonnull="guessing yes" ;; - # If we don't know, obey --enable-cross-guesses. - *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;; + # Guess as follows if we don't know. + *) ac_cv_func_malloc_0_nonnull= ;; esac else case e in #( That is, the variable ac_cv_func_malloc_0_nonnull gets an empty value, although the value ought to be ending in 'yes' or ending in 'no'. This change fixes it (but obviously needs NOT be backpropagated into Autoconf). 2024-10-31 Bruno Haible <br...@clisp.org> malloc-posix, realloc-posix: Fix incorrect expansion of AC_FUNC_MALLOC. * m4/malloc.m4 (_AC_FUNC_MALLOC_IF): Handle the case of a missing third argument. * m4/realloc.m4 (_AC_FUNC_REALLOC_IF): Likewise. diff --git a/m4/malloc.m4 b/m4/malloc.m4 index d5985fc75f..06a8b7b5ed 100644 --- a/m4/malloc.m4 +++ b/m4/malloc.m4 @@ -1,5 +1,5 @@ # malloc.m4 -# serial 38 +# serial 39 dnl Copyright (C) 2007, 2009-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, @@ -39,7 +39,7 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF] | hpux* | solaris* | cygwin* | mingw* | windows* | msys* ) ac_cv_func_malloc_0_nonnull="guessing yes" ;; # Guess as follows if we don't know. - *) ac_cv_func_malloc_0_nonnull=$3 ;; + *) ac_cv_func_malloc_0_nonnull=m4_if([$3],[],["guessing no"],[$3]) ;; esac ]) ]) diff --git a/m4/realloc.m4 b/m4/realloc.m4 index a48dc1cfe5..62aca6dd28 100644 --- a/m4/realloc.m4 +++ b/m4/realloc.m4 @@ -1,5 +1,5 @@ # realloc.m4 -# serial 35 +# serial 36 dnl Copyright (C) 2007, 2009-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, @@ -51,7 +51,7 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF] | hpux* | solaris* | cygwin* | mingw* | windows* | msys* ) ac_cv_func_realloc_0_nonnull="guessing yes" ;; # Guess as follows if we don't know. - *) ac_cv_func_realloc_0_nonnull=$3 ;; + *) ac_cv_func_realloc_0_nonnull=m4_if([$3],[],["guessing no"],[$3]) ;; esac ]) ])