]> Savannah Git Hosting - gnulib.git/commitdiff
calloc, malloc: Fix a comment.
authorBruno Haible <bruno@clisp.org>
Tue, 5 Nov 2024 14:53:47 +0000 (15:53 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 5 Nov 2024 14:53:47 +0000 (15:53 +0100)
* m4/malloc.m4 (gl_FUNC_MALLOC_GNU): Mention that it sets
HAVE_MALLOC_PTRDIFF.
(gl_FUNC_MALLOC_PTRDIFF): Likewise.
(gl_CHECK_MALLOC_PTRDIFF): Do not mention HAVE_MALLOC_PTRDIFF here.

ChangeLog
m4/malloc.m4

index 0d9114ca3c8b06dc0b809d6756b02c8bacb624b2..aca62308e01226c13b1174d99410027dcb5befc3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2024-11-05  Bruno Haible  <bruno@clisp.org>
 
+       calloc, malloc: Fix a comment.
+       * m4/malloc.m4 (gl_FUNC_MALLOC_GNU): Mention that it sets
+       HAVE_MALLOC_PTRDIFF.
+       (gl_FUNC_MALLOC_PTRDIFF): Likewise.
+       (gl_CHECK_MALLOC_PTRDIFF): Do not mention HAVE_MALLOC_PTRDIFF here.
+
        calloc: Fix configure test (regression yesterday).
        * m4/calloc.m4 (gl_FUNC_CALLOC_IF): Fix wrong cache variable name.
        Rename cache variable. Restore earlier comment.
index deb0de24ded0ae8950234b23b118615ef94d2e09..bad5ee950178fff0785788da3f5b7c38ef76f3f3 100644 (file)
@@ -1,5 +1,5 @@
 # malloc.m4
-# serial 41
+# serial 42
 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,
@@ -45,8 +45,12 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF],
 
 # gl_FUNC_MALLOC_GNU
 # ------------------
-# Define HAVE_MALLOC_0_NONNULL if malloc (0) returns nonnull.
-# Replace malloc if it is not compatible with GNU libc.
+# Test whether malloc (0) is compatible with GNU libc.
+# Replace malloc if not.
+# Define HAVE_MALLOC_0_NONNULL if malloc (0) returns nonnull (except upon
+# out-of-memory).
+# Define HAVE_MALLOC_PTRDIFF if malloc (N) reliably fails when N exceeds
+# PTRDIFF_MAX.
 AC_DEFUN([gl_FUNC_MALLOC_GNU],
 [
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
@@ -66,8 +70,9 @@ AC_DEFUN([gl_FUNC_MALLOC_GNU],
 
 # gl_FUNC_MALLOC_PTRDIFF
 # ----------------------
-# Test whether malloc (N) reliably fails when N exceeds PTRDIFF_MAX,
-# and replace malloc otherwise.
+# Test whether malloc (N) reliably fails when N exceeds PTRDIFF_MAX.
+# Define HAVE_MALLOC_PTRDIFF if yes.
+# Replace malloc if not.
 AC_DEFUN([gl_FUNC_MALLOC_PTRDIFF],
 [
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
@@ -81,7 +86,7 @@ AC_DEFUN([gl_FUNC_MALLOC_PTRDIFF],
 
 # Test whether malloc, realloc, calloc refuse to create objects
 # larger than what can be expressed in ptrdiff_t.
-# Set gl_cv_func_malloc_gnu and define MALLOC_PTRDIFF accordingly.
+# Set gl_cv_func_malloc_gnu.
 AC_DEFUN([gl_CHECK_MALLOC_PTRDIFF],
 [
   AC_CACHE_CHECK([whether malloc is ptrdiff_t safe],