[cfe-dev] Question on -Wswitch-enum

John Wiegley johnw at boostpro.com
Fri Aug 3 11:22:42 PDT 2012


>>>>> Nicola Gigante <nicola.gigante at gmail.com> writes:

> In my opinion, the presence of the default: label in the switch statement
> should silence this warning, because those enumeration values are actually
> handled. It's not like something like this: switch(e) { case First: return
> 42; case Second: return 84; }

I actually opened a bug on this behavior, it was counter-intuitive to me as
well.  The resolution was that it's not always desirable to make -Weverything
compile silently.  You need to add a few -Won- directives as well.

-- 
John Wiegley
BoostPro Computing                  Software Development        Training
http://www.boostpro.com             Clang/LLVM/EDG Compilers  C++  Boost



More information about the cfe-dev mailing list