-Wunreachable-code doesn't warn on empty statement bodies for the
switch. So, for instance:
int main() {
int i = 0;
switch(i) {}
}
yields no warnings in clang with -Wunreachable-code (or -Wall), but at
/W3 in MSVC you get: warning C4060: switch statement contains no
'case' or 'default' labels. Will it catch lots of bugs? Probably
not. But it also should have basically no false positives either. It
would be nice for people who want their code to also be warning-free
under MSVC.
~Aaron
On Tue, May 28, 2013 at 11:07 PM, Richard Smith <[email protected]> wrote:
> What kinds of bugs does this catch that -Wunreachable-code misses?
>
> On Tue, May 28, 2013 at 8:27 AM, Aaron Ballman <[email protected]>
> wrote:
>>
>> This patch addresses PR4546; it warns when a switch statement contains
>> a body, but the body does not contain any case or default labels.
>>
>> ~Aaron
>>
>> _______________________________________________
>> cfe-commits mailing list
>> [email protected]
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits