From cb1e736c49665a12a7d22f5fd87f3f63bb8886d3 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 31 Oct 2024 22:11:22 +0100 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ m4/malloc.m4 | 4 ++-- m4/realloc.m4 | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e791d61428..59a709aae8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-10-31 Bruno Haible + + 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. + 2024-10-31 Bruno Haible malloc-gnu, eealloc: Make code more future-proof. 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 ]) ]) -- 2.39.5