On 11/30/2009 03:55 PM, Markus Armbruster wrote:
Commit a7d27b53 made zero-sized allocations a fatal error, deviating
from ISO C's malloc()&  friends.  Revert that, but take care never to
return a null pointer, like malloc()&  friends may do (it's
implementation defined), because that's another source of bugs.

Rationale: while zero-sized allocations might occasionally be a sign of
something going wrong, they can also be perfectly legitimate.  The
change broke such legitimate uses.  We've found and "fixed" at least one
of them already (commit eb0b64f7, also reverted by this patch), and
another one just popped up: the change broke qcow2 images with virtual
disk size zero, i.e. images that don't hold real data but only VM state
of snapshots.

I strongly agree with this patch. A consistent API improves quality, especially when it is also consistent with people's expectations.

--
error compiling committee.c: too many arguments to function



Reply via email to