[libvirt] [PATCH] build: allow virObject to have no parent

Eric Blake eblake at redhat.com
Tue Jan 22 20:46:32 UTC 2013


On 01/22/2013 10:23 AM, Daniel P. Berrange wrote:
> On Tue, Jan 22, 2013 at 10:15:20AM -0700, Eric Blake wrote:
>> When building with static analysis enabled, we turn on attribute
>> nonnull checking.  However, this caused the build to fail with:
>>
>> ../../src/util/virobject.c: In function 'virObjectOnceInit':
>> ../../src/util/virobject.c:55:40: error: null argument where non-null required (argument 1) [-Werror=nonnull]
>>
>> Creation of the virObject class is the one instance where the
>> parent class is allowed to be NULL, so making things conditional
>> will let us keep static analysis checking for all other callers,
>> without breaking the build on the one exception.
>>
>> * src/util/virobject.c: Define witness.
>> * src/util/virobject.h (virClassNew): Use it to force most callers
>> to pass non-null parameter.
>> ---
>>

> ACK

Thanks; pushed.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130122/3aef2802/attachment-0001.sig>


More information about the libvir-list mailing list