From: Bruno Haible <bruno@clisp.org>
Date: Thu, 31 Oct 2024 21:04:42 +0000 (+0100)
Subject: malloc-gnu, eealloc: Make code more future-proof.
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=0d39c0a046a4f12bbc7dcfd6385612c68f3401ba;p=gnulib.git

malloc-gnu, eealloc: Make code more future-proof.

* m4/malloc.m4 (gl_FUNC_MALLOC_GNU): Protect evaluation of
$gl_cross_guess_normal.
* m4/eealloc.m4 (gl_EEMALLOC, gl_EEREALLOC): Likewise.
---

diff --git a/ChangeLog b/ChangeLog
index dc16a1fda9..e791d61428 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-10-31  Bruno Haible  <bruno@clisp.org>
+
+	malloc-gnu, eealloc: Make code more future-proof.
+	* m4/malloc.m4 (gl_FUNC_MALLOC_GNU): Protect evaluation of
+	$gl_cross_guess_normal.
+	* m4/eealloc.m4 (gl_EEMALLOC, gl_EEREALLOC): Likewise.
+
 2024-10-31  Bruno Haible  <bruno@clisp.org>
 
 	malloc-posix, calloc-posix, realloc-posix: Optimize on MSVC.
diff --git a/m4/eealloc.m4 b/m4/eealloc.m4
index 42ab030f38..0ad90c687b 100644
--- a/m4/eealloc.m4
+++ b/m4/eealloc.m4
@@ -1,5 +1,5 @@
 # eealloc.m4
-# serial 4
+# serial 5
 dnl Copyright (C) 2003, 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,
@@ -17,7 +17,7 @@ AC_DEFUN([gl_EEMALLOC],
   _AC_FUNC_MALLOC_IF(
     [gl_cv_func_malloc_0_nonnull=1],
     [gl_cv_func_malloc_0_nonnull=0],
-    [$gl_cross_guess_normal])
+    ["$gl_cross_guess_normal"])
   AC_DEFINE_UNQUOTED([MALLOC_0_IS_NONNULL], [$gl_cv_func_malloc_0_nonnull],
     [If malloc(0) is != NULL, define this to 1.  Otherwise define this
      to 0.])
@@ -28,7 +28,7 @@ AC_DEFUN([gl_EEREALLOC],
   _AC_FUNC_REALLOC_IF(
     [gl_cv_func_realloc_0_nonnull=1],
     [gl_cv_func_realloc_0_nonnull=0],
-    [$gl_cross_guess_normal])
+    ["$gl_cross_guess_normal"])
   AC_DEFINE_UNQUOTED([REALLOC_0_IS_NONNULL], [$gl_cv_func_realloc_0_nonnull],
     [If realloc(NULL,0) is != NULL, define this to 1.  Otherwise define this
      to 0.])
diff --git a/m4/malloc.m4 b/m4/malloc.m4
index d7684f418c..d5985fc75f 100644
--- a/m4/malloc.m4
+++ b/m4/malloc.m4
@@ -1,5 +1,5 @@
 # malloc.m4
-# serial 37
+# serial 38
 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,
@@ -62,7 +62,7 @@ AC_DEFUN([gl_FUNC_MALLOC_GNU],
   REPLACE_MALLOC_FOR_MALLOC_GNU="$REPLACE_MALLOC_FOR_MALLOC_POSIX"
   if test $REPLACE_MALLOC_FOR_MALLOC_GNU = 0; then
     _AC_FUNC_MALLOC_IF([], [REPLACE_MALLOC_FOR_MALLOC_GNU=1],
-      [$gl_cross_guess_normal])
+      ["$gl_cross_guess_normal"])
   fi
 ])