• E
    build: allow virObject to have no parent · 682c79c4
    Eric Blake 提交于
    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.
    682c79c4
virobject.c 9.1 KB