Thanks for the awesome update. A few tiny comments inline.

On Wed, Apr 25, 2012 at 2:08 PM, Alexander Kornienko <ale...@google.com>wrote:

> Hi,
>
> On Wed, Apr 25, 2012 at 6:12 PM, Alexander Kornienko <ale...@google.com>wrote:
>
>> The new version of patch addresses most of the issues discussed here +
>> refactored code ;)
>>
>
> More specifically, changes in this version of patch:
>  * diagnostic message reworded; each warning is accompanied by exactly one
> note with a fix-it hint, for simplicity and consistency the location to
> insert fall-through annotation is always immediately before the relevant
> case label:
> test.cpp:16:5: warning: unannotated fall-through between switch labels
> [-Wimplicit-fallthrough]
>     case 13:
>     ^
> test.cpp:16:5: note: insert [[fallthrough]]; to silence this warning
> [-Wimplicit-fallthrough]
>

s/to silence this warning/to annotate the fall-through as intentional/ ?


>     case 13:
>     ^
>     [[fallthrough]];
>  * added specific diagnostic message for unreachable fall-through
> annotation, e.g. this code:
>
> switch(x) {
> case 1:
>   break;
>   [[fallthrough]];
> case 2:
> ...
>
> will produce a similar warning:
> test.cpp:12:7: warning: fallthrough annotation in unreachable code
> [-Wimplicit-fallthrough]
>       [[fallthrough]];
>       ^
>

Idea for a future iteration: add a note that points to the break here, at
least in the easy cases. We should be able to find the terminator of the
CFG block which precedes this somehow.


More comments on your other email.
_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to