1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

Let Gnulib deal with malloc/realloc 0

Instead of worrying about whether malloc and realloc yield a
non-null pointer when given size 0 (the traditional behavior
recommended by Doug McIlroy, and the only behavior that makes
sense for Emacs), let Gnulib arrange for the traditional behavior.
* admin/merge-gnulib (GNULIB_MODULES): Add malloc-gnu (which we
were already depending on indirectly) and realloc-posix.
* lib/gnulib.mk.in, m4/gnulib-comp.m4:
Regenerate by running admin/merge-gnulib.
This commit is contained in:
Paul Eggert 2025-01-16 23:28:34 -08:00
parent 9eefe7ccda
commit 29794c7145
3 changed files with 14 additions and 41 deletions

View file

@ -132,6 +132,7 @@
# largefile \
# libgmp \
# lstat \
# malloc-gnu \
# manywarnings \
# memmem-simple \
# mempcpy \
@ -150,6 +151,7 @@
# qcopy-acl \
# readlink \
# readlinkat \
# realloc-posix \
# regex \
# sig2str \
# sigdescr_np \
@ -1478,14 +1480,12 @@ gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7_CONDITION = @gl_GNULIB_ENABLE
gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b_CONDITION = @gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b_CONDITION@
gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31_CONDITION = @gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31_CONDITION@
gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c_CONDITION = @gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c_CONDITION@
gl_GNULIB_ENABLED_61bcaca76b3e6f9ae55d57a1c3193bc4_CONDITION = @gl_GNULIB_ENABLED_61bcaca76b3e6f9ae55d57a1c3193bc4_CONDITION@
gl_GNULIB_ENABLED_8444034ea779b88768865bb60b4fb8c9_CONDITION = @gl_GNULIB_ENABLED_8444034ea779b88768865bb60b4fb8c9_CONDITION@
gl_GNULIB_ENABLED_925677f0343de64b89a9f0c790b4104c_CONDITION = @gl_GNULIB_ENABLED_925677f0343de64b89a9f0c790b4104c_CONDITION@
gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1_CONDITION = @gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1_CONDITION@
gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_CONDITION = @gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_CONDITION@
gl_GNULIB_ENABLED_cloexec_CONDITION = @gl_GNULIB_ENABLED_cloexec_CONDITION@
gl_GNULIB_ENABLED_dirfd_CONDITION = @gl_GNULIB_ENABLED_dirfd_CONDITION@
gl_GNULIB_ENABLED_e80bf6f757095d2e5fc94dafb8f8fc8b_CONDITION = @gl_GNULIB_ENABLED_e80bf6f757095d2e5fc94dafb8f8fc8b_CONDITION@
gl_GNULIB_ENABLED_endian_CONDITION = @gl_GNULIB_ENABLED_endian_CONDITION@
gl_GNULIB_ENABLED_euidaccess_CONDITION = @gl_GNULIB_ENABLED_euidaccess_CONDITION@
gl_GNULIB_ENABLED_fd38c7e463b54744b77b98aeafb4fa7c_CONDITION = @gl_GNULIB_ENABLED_fd38c7e463b54744b77b98aeafb4fa7c_CONDITION@
@ -2688,9 +2688,7 @@ endif
## begin gnulib module malloc-gnu
ifeq (,$(OMIT_GNULIB_MODULE_malloc-gnu))
ifneq (,$(gl_GNULIB_ENABLED_e80bf6f757095d2e5fc94dafb8f8fc8b_CONDITION))
endif
EXTRA_DIST += malloc.c
EXTRA_libgnu_a_SOURCES += malloc.c
@ -2933,12 +2931,10 @@ endif
## begin gnulib module realloc-posix
ifeq (,$(OMIT_GNULIB_MODULE_realloc-posix))
ifneq (,$(gl_GNULIB_ENABLED_61bcaca76b3e6f9ae55d57a1c3193bc4_CONDITION))
ifneq (,$(GL_COND_OBJ_REALLOC_POSIX_CONDITION))
libgnu_a_SOURCES += realloc.c
endif
endif
endif
## end gnulib module realloc-posix