On 03/25/2011 11:40 AM, Paul Eggert wrote:
> On 03/25/2011 09:31 AM, Eric Blake wrote:
>> xrealloc(NULL,0) _must_ return malloc(0) rather than blindly returning NULL.
> 
> Yes, that makes sense too.  Thanks for thinking it through.
> 
> The change you just installed causes xrealloc (NULL, 0)
> to return realloc (NULL, 0) without failing, which boils
> down to the same thing (and is arguably better, on weird
> implementations where malloc (0) and realloc (NULL, 0)
> have different semantics).

Pedantically, any system where malloc(0) and realloc(NULL,0) behave
differently is buggy, since C99 defines the latter in terms of the
former.  :)

-- 
Eric Blake   [email protected]    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to