Replace -Wswitch-enum with -Wswitch, and add it into cmake rules too According to https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html: -Wswitch-enum Warn whenever a switch statement has an index of enumerated type and lacks a case for one or more of the named codes of that enumeration. case labels outside the enumeration range also provoke warnings when this option is used. The only difference between -Wswitch and this option is that this option gives a warning about an omitted enumeration code even if there is a *default label*.