On 02/20/2018 12:08 PM, Daniel P. Berrangé wrote:
As a general rule any time we switch() on something that is an enum,
we
want to have a case for every enum constant. The -Wswitch warning will
report any switch where we've violated this rule, except if that switch
has a default case.
Unfortunately it is reasonable to want to list all enum constants *and*
also have a default case. To get a warning in that scenario requires
that we turn on -Wswitch-enum.
In a few cases where we explicitly don't want to list all enum cases, we
can discard the enum type checking by casting the value to a plain int.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
m4/virt-compile-warnings.m4 | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
Reviewed-by: John Ferlan <jferlan(a)redhat.com>
John