On 3/27/19 6:38 AM, Ján Tomko wrote: > On Wed, Mar 27, 2019 at 05:10:32AM -0500, Eric Blake wrote: >> The qemu driver already had a full-blown virDomainMomentObjPtr to >> check against, and the test driver ought to have one since we get >> better error checking that the user passed in a valid object. Removes >> a helper function added in commit commit 4819f54b. >> >> Signed-off-by: Eric Blake <eblake@xxxxxxxxxx> >> --- >> @@ -6249,14 +6249,19 @@ >> testDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot, >> { >> virDomainObjPtr vm = NULL; >> int ret; > > ret = -1; > > otherwise clang complains: > test/test_driver.c:6259:9: error: variable 'ret' is used uninitialized > whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] > if (!(snap = testSnapObjFromSnapshot(vm, snapshot))) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > test/test_driver.c:6266:12: note: uninitialized use occurs here > return ret; > ^~~ > test/test_driver.c:6259:5: note: remove the 'if' if its condition is > always false > if (!(snap = testSnapObjFromSnapshot(vm, snapshot))) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > test/test_driver.c:6251:12: note: initialize the variable 'ret' to > silence this warning > int ret; > ^ > = 0 > 1 error generated. > > Jano Yep, fixed and pushed 1-3 to get them out of the way. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list