Why does Clang/LLVM warn me about using default in a switch statement where all enumerated cases are covered?
- by Thomas Catterall
Consider the following enum and switch statement:
typedef enum {
MaskValueUno,
MaskValueDos
} testingMask;
void myFunction(testingMask theMask) {
switch theMask {
case MaskValueUno: {}// deal with it
case MaskValueDos: {}// deal with it
default: {} //deal with an unexpected or uninitialized value
}
};
I'm…