Cleaning up old c/c++ code that used hardcoded integer literals instead of enums, it is tedious to find places where the function-declaration has been properly refactored but not the body. e.g.
enum important {
little = 1,
abit = 2,
much = 3
};
void blah(int e)
{
// magic stuff here
}
void boing(int e) { ... }
void guck(important e)
{
switch (e) {
case 3: // this would be a good place for a warning
blah(e); // and this
break;
default:
boing((int)e); // but this is OK (although imperfect and a warning would be acceptable)
break;
}
}
Annotating/modifying each enum type or searching through the code for them would also be a fair amount of work as there are very very many different enums, so this is not preferred, but could be an acceptable solution.
I don't need it to be in any of our main compilers or other tools (gcc mostly) or platform (most), running it manually a couple of times would be enough, but I would prefer something that is not too esoteric or pricy.