[libvirt] [PATCH] libxl: Resove Coverity dead_error_begin

Coverity complains about default: label not be able to be reached. It's by design for the code, so just add a Coverity tag for dead_error_begin Signed-off-by: John Ferlan <jferlan@redhat.com> --- src/libxl/libxl_driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index fc0efa2..513a597 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -4168,6 +4168,7 @@ libxlDomainGetNumaParameters(virDomainPtr dom, break; + /* coverity[dead_error_begin] */ default: break; } -- 1.8.4.2

On 01/31/2014 09:35 AM, John Ferlan wrote:
Coverity complains about default: label not be able to be reached. It's by design for the code, so just add a Coverity tag for dead_error_begin
Signed-off-by: John Ferlan <jferlan@redhat.com> --- src/libxl/libxl_driver.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index fc0efa2..513a597 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -4168,6 +4168,7 @@ libxlDomainGetNumaParameters(virDomainPtr dom,
break;
+ /* coverity[dead_error_begin] */ default: break; }
Why not just delete the label instead; then you don't need a Coverity marker? -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 01/31/2014 11:45 AM, Eric Blake wrote:
On 01/31/2014 09:35 AM, John Ferlan wrote:
Coverity complains about default: label not be able to be reached. It's by design for the code, so just add a Coverity tag for dead_error_begin
Signed-off-by: John Ferlan <jferlan@redhat.com> --- src/libxl/libxl_driver.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index fc0efa2..513a597 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -4168,6 +4168,7 @@ libxlDomainGetNumaParameters(virDomainPtr dom,
break;
+ /* coverity[dead_error_begin] */ default: break; }
Why not just delete the label instead; then you don't need a Coverity marker?
So are you advocating for removal of the other [dead_error_begin] conditions in the same manner? see src/lxc/lxc_driver.c (3 occurrences) and src/nodeinfo.c (1 occurrence). John

On 01/31/2014 10:11 AM, John Ferlan wrote:
+ /* coverity[dead_error_begin] */ default: break; }
Why not just delete the label instead; then you don't need a Coverity marker?
So are you advocating for removal of the other [dead_error_begin] conditions in the same manner?
see src/lxc/lxc_driver.c (3 occurrences) and src/nodeinfo.c (1 occurrence).
Sure - it's fewer lines of code, with no semantic difference, and with no static checker warning. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
John Ferlan