]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuNodeDeviceDetachFlags: Avoid use of uninitialized variables
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 2 Jul 2013 09:20:53 +0000 (11:20 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 2 Jul 2013 10:39:14 +0000 (12:39 +0200)
commitbc09c5d3355483bbf4cec55ca82689ae67af6d44
tree45523f035865fcb767864c15b91d1a1dc7b45d57
parent5daa1b0132bdea9226bf57b8fb1cf9b68ab6f628
qemuNodeDeviceDetachFlags: Avoid use of uninitialized variables

After abf75aea24 the compiler screams:

qemu/qemu_driver.c: In function 'qemuNodeDeviceDetachFlags':
qemu/qemu_driver.c:10693:9: error: 'domain' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     pci = virPCIDeviceNew(domain, bus, slot, function);
         ^
qemu/qemu_driver.c:10693:9: error: 'bus' may be used uninitialized in this function [-Werror=maybe-uninitialized]
qemu/qemu_driver.c:10693:9: error: 'slot' may be used uninitialized in this function [-Werror=maybe-uninitialized]
qemu/qemu_driver.c:10693:9: error: 'function' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Since the other functions qemuNodeDeviceReAttach and qemuNodeDeviceReset
looks exactly the same, I've initialized the variables there as well.
However, I am still wondering why those functions don't matter to gcc
while the first one does.
src/qemu/qemu_driver.c