[webkit-dev] Can we disable "control reaches end of non-void function" warning on Qt?
darin at apple.com
Fri Sep 13 10:33:43 PDT 2013
On Sep 13, 2013, at 10:31 AM, Oliver Hunt <oliver at apple.com> wrote:
> We may want to hunt through the other cases of default: ASSERT_NOT_REACHED() and clobber those with RELEASE_ASSERT_NOT_REACHED() as well.
> I wonder if it would be easier to have DEFAULT_NOT_REACHED() and DEFAULT_OKAY() macros, and convince the style bot to require ether a default: block or one of these two macros at the end of every switch?
The advantage of doing the not-reached assertion after the switch is that we get the compile time warning if we don’t enumerate one of the enum values. Having a default case turns that warning off.
More information about the webkit-dev