On 2024-10-19 08:19, Bruno Haible wrote:
Alejandro Colomar wrote in
<https://sourceware.org/pipermail/libc-alpha/2024-October/160645.html>:
- glibc, in 2006/2007, made a so-called bugfix change to conform to
C89, which effectively made realloc(p,0) non-conforming to C99. This
happened in the following commit:
commit 11bf311edc76f5ddc469a8c396e313e82d76be15
Author: Ulrich Drepper <drep...@redhat.com>
Date: Thu Jan 11 21:51:07 2007 +0000
[BZ #2510, BZ #2830, BZ #3137, BZ #3313, BZ #3426, BZ #3465, BZ
#3480, BZ #3483, BZ #
3493, BZ #3514, BZ #3515, BZ #3664, BZ #3673, BZ #3674]
[...]
2006-12-08 Ulrich Drepper <drep...@redhat.com>
* malloc/memusage.c: Handle realloc with new size of zero
and
non-NULL pointer correctly.
[...]
This statement is incorrect. I tested the behaviour of realloc (ptr, 0)
on a glibc 2.3.2 from 2003 (Fedora 1), and it is the same as the behaviour
of recent glibcs. The commit above affects only the realloc override in
libmemusage.so, which normal programs rarely use.
Bruno
Yeah, it's more likely this one:
commit 7c2b945e1fd64e0a5a4dbd6ae6592a7314dcd4b5
Author: Ulrich Drepper <drep...@redhat.com>
Date: Wed Apr 28 10:20:18 1999 +0000
Update.
* malloc/malloc.c (rEALLOc): Only free memory for size 0 if
oldmem
is != NULL.
1999-04-28 Andreas Jaeger <a...@arthur.rhein-neckar.de>
* malloc/malloc.c (REALLOC_ZERO_BYTES_FREES): Define it to
follow
ISO C9x and Unix98.
1999-04-28 Ulrich Drepper <drep...@cygnus.com>
--
Sid