On 10/10/2014 10:59 AM, Anirban Chakraborty wrote:
The list is really very long to put all in here. If we have to do
what you
suggested, then we’d be changing all such usage of switch statements,
which is not trivial, I believe.
The point of adding it to HACKING is to encourage new code to abide by
the standard, and not necessarily to retrofit existing code. And you
are correct that existing code doesn't always use enum type-safety
compiler guarantees - which makes the enum that much harder to modify
later if we ever add enum values. But in some cases, it is fairly
obvious that we don't plan to add any enum values, in which case a
simple if statement or use of a default label is fine. It's a
case-by-case judgment call of what makes the code easier to maintain.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org