[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] qemu: Resolve Coverity DEADCODE



On Mon, Apr 27, 2015 at 07:33:06 -0400, John Ferlan wrote:
> Coverity notes taht the switch() used to check 'connected' values has
> two DEADCODE paths (_DEFAULT & _LAST).  Since 'connected' is a boolean
> it can only be one or the other (CONNECTED or DISCONNECTED), so it just
> seems pointless to use a switch to get "all" values.  Convert to if-else

Well, if you add a new state to the VIR_DOMAIN_CHR_DEVICE_STATE_* enum,
the compiler won't warn you that you need to check yet another place if
you use the if-else statement. That is the exact reason to use switch here.

I hate coverity for this and I hope it will not bite me once I'll have
to touch the code.

Against-will ACK.

Peter

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]