]> Savannah Git Hosting - gnulib.git/commit
realloc: Optionally check for undefined behaviour.
authorBruno Haible <bruno@clisp.org>
Mon, 21 Oct 2024 13:29:40 +0000 (15:29 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 21 Oct 2024 15:14:01 +0000 (17:14 +0200)
commit12cd6eca2058105f81c3a5dc739e82f965ca18bf
tree179b10802afb84bf833e3d1828aae8283e8f1edd
parent6af4a4ef0d1be2f133937ae1f6686770787bb47d
realloc: Optionally check for undefined behaviour.

* m4/realloc.m4 (gl_FUNC_REALLOC_SANITIZED): New macro.
(gl_FUNC_REALLOC_POSIX): Require it. If a sanitized realloc is
requested, define NEED_SANITIZED_REALLOC and compile realloc.c.
(gl_FUNC_REALLOC_GNU): Require it. If a sanitized realloc is requested,
don't compile realloc.c a second time.
* lib/realloc.c (rpl_realloc): If NEED_SANITIZED_REALLOC is defined,
abort in the case of undefined behaviour.
ChangeLog
lib/realloc.c
m4/realloc.m4