• M
    Initialize couple of variables. · b1bae297
    Michal Privoznik 提交于
    While trying to build with -Os couple of compile errors showed
    up.
    
    conf/domain_conf.c: In function 'virDomainChrRemove':
    conf/domain_conf.c:13666:24: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]
         virDomainChrDefPtr ret, **arrPtr = NULL;
                            ^
    Compiler fails to see that @ret is used only if set in the loop,
    but whatever, there's no harm in initializing the variable.
    
    In vboxAttachDrivesNew and _vboxAttachDrivesOld compiler thinks
    that @rc may be used uninitialized. Well, not directly, but maybe
    after some optimization. Yet again, no harm in initializing a
    variable.
    
    In file included from ./util/virthread.h:26:0,
                     from ./datatypes.h:28,
                     from vbox/vbox_tmpl.c:43,
                     from vbox/vbox_V3_1.c:37:
    vbox/vbox_tmpl.c: In function '_vboxAttachDrivesOld':
    ./util/virerror.h:181:5: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized]
         virReportErrorHelper(VIR_FROM_THIS, code, __FILE__,              \
         ^
    In file included from vbox/vbox_V3_1.c:37:0:
    vbox/vbox_tmpl.c:1041:14: note: 'rc' was declared here
         nsresult rc;
                  ^
    Yet again, one uninitialized variable:
    
    qemu/qemu_driver.c: In function 'qemuDomainBlockCommit':
    qemu/qemu_driver.c:17194:9: error: 'baseSource' may be used uninitialized in this function [-Werror=maybe-uninitialized]
             qemuDomainPrepareDiskChainElement(driver, vm, baseSource,
             ^
    
    And another one:
    
    storage/storage_backend_logical.c: In function 'virStorageBackendLogicalMatchPoolSource.isra.2':
    storage/storage_backend_logical.c:618:33: error: 'thisSource' may be used uninitialized in this function [-Werror=maybe-uninitialized]
                           thisSource->devices[j].path))
                                     ^
    Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
    (cherry picked from commit bde6e002)
    b1bae297
storage_backend_logical.c 33.6 KB