This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Why was the reallocarray function not added to glibc?
The patch should use gcc builtins (when available) to detect integer
overflow instead of trying to do it by hand. You can do this by using
the INT_MULTIPLY_OVERFLOW macro of Gnulib, documented here:
https://www.gnu.org/software/gnulib/manual/html_node/Integer-Type-Overflow.html
The easist way to use that macro is to copy gnulib intprops.h as-is into
glibc, and then use "#include <intprops.h>". It need not be a public
include file. Here's the current source:
http://git.savannah.gnu.org/cgit/gnulib.git/tree/lib/intprops.h