[webkit-dev] Can we disable "control reaches end of non-void function" warning on Qt?

Oliver Hunt oliver at apple.com
Fri Sep 13 10:31:47 PDT 2013


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?

--Oliver

On Sep 13, 2013, at 10:29 AM, Darin Adler <darin at apple.com> wrote:

> On Sep 13, 2013, at 10:28 AM, Alexey Proskuryakov <ap at apple.com> wrote:
> 
>> 13 сент. 2013 г., в 10:13, Darin Adler <darin at apple.com> написал(а):
>> 
>>> Since there’s no runtime guarantee that the enum will have a valid value, I think there needs to be a return statement outside the switch, even if we have ASSERT_NOT_REACHED before it.
>> 
>> Should it be a RELEASE_ASSERT? If we have a bad value in an enum, it's likely a memory smasher, so it's best to crash before it's exploited.
> 
> Sure, that’d be OK with me.
> 
> -- Darin
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev



More information about the webkit-dev mailing list