]> git.ipfire.org Git - thirdparty/libvirt.git/commit
build: allow virObject to have no parent
authorEric Blake <eblake@redhat.com>
Tue, 22 Jan 2013 17:13:01 +0000 (10:13 -0700)
committerEric Blake <eblake@redhat.com>
Tue, 22 Jan 2013 20:45:38 +0000 (13:45 -0700)
commit682c79c4f5496ef1d21cab52cad0ba609bb0b9cf
tree7133f656eb0398888379b5ec991d4186e6b5c032
parent55bfd020d8d9de40977832c4762728090df2bee3
build: allow virObject to have no parent

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.  Making things conditional
will let us keep static analysis checking for all other .c file
callers, without breaking the build on this one exception.

* src/util/virobject.c: Define witness.
* src/util/virobject.h (virClassNew): Use it to force most callers
to pass non-null parameter.
src/util/virobject.c
src/util/virobject.h