[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:36:59 PDT 2013


Hurk :-/

I guess there's no nice automate-able to handle everything magically.

Still it would probably be good to replace the default:ASSERT_NOT_REACHED() cases at least.

--Oliver

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

> 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?
> 
> 
> Maybe.
> 
> 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.
> 
> -- Darin



More information about the webkit-dev mailing list