From: Michal Privoznik Date: Thu, 31 Mar 2016 14:45:11 +0000 (+0200) Subject: qemuProcessVerifyGuestCPU: Avoid coverity false positive X-Git-Tag: v1.3.3-rc2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=382ea24b1a57d745eecf2f7aa63c7c99981eacc0;p=thirdparty%2Flibvirt.git qemuProcessVerifyGuestCPU: Avoid coverity false positive We use _LAST items in enums to mark the last position in given enum. Now, if and enum is passed to switch(), compiler checks that all the values from enum occur in 'case' enumeration. Including _LAST. But coverity spots it's a dead code. And it really is. So to resolve this, we tend to put a comment just above 'case ..._LAST' notifying coverity that we know this is a dead code but we want to have it that way. Signed-off-by: Michal Privoznik --- diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 07b9df2739..e58bf16eaa 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3953,6 +3953,8 @@ qemuProcessVerifyGuestCPU(virQEMUDriverPtr driver, virDomainHypervTypeToString(i)); goto cleanup; break; + + /* coverity[dead_error_begin] */ case VIR_DOMAIN_HYPERV_LAST: break; }