This is the mail archive of the
libc-alpha@cygnus.com
mailing list for the glibc project.
Re: [Andrew Pimlott <pimlott@abel.MATH.HARVARD.EDU>] realloc(p, 0) vs. free
> No. Please look at the change I've added.
>
> realloc (NULL, 0) == malloc (0)
>
> realloc (ptr, 0) == free (ptr)
OK, that adds at least a little bit of consistency.
Of course I agree that standards compliance takes precedence over
almost anything, I was just surprised that the standard would allow
malloc(0) to behave in two ways while defining the analogous realloc()
rigorously.
Regards,
Wolfram.
--
`Surf the sea, not double-u three...'
wmglo@dent.med.uni-muenchen.de