<div class="gmail_quote">On Thu, Jul 26, 2012 at 4:24 PM, Jim Grosbach <span dir="ltr"><<a href="mailto:grosbach@apple.com" target="_blank">grosbach@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
On Jul 26, 2012, at 4:07 PM, Chris Lattner <<a href="mailto:clattner@apple.com">clattner@apple.com</a>> wrote:<br>
<br>
> <dropping llvm-commits><br>
><br>
> On Jul 2, 2012, at 9:59 AM, Alexander Kornienko wrote:<br>
><br>
>> Hi llvmdev, llvm-commits,<br>
>><br>
>> There was a discussion on this topic a while ago, and now I've decided to make a formal proposal and post it here.<br>
><br>
> I missed the earlier discussion, so I'm sorry for chiming in late.<br>
><br>
>> I propose to add the LLVM_FALLTHROUGH macro for specifying intended fall-through locations between switch cases.<br>
><br>
> I don't really see that the tradeoff here is worthwhile.  It is possible that we have some fallthrough bugs, but the cost of sprinkling this macro everywhere doesn't seem like the right tradeoff.<br>
><br>
<br>
</div>While I tend to agree with you, it's also true that for many (most?) of the locations where we have an intentional fall through, there's already a comment to that effect as a matter of style. This would simply formalize that currently voluntary bit of style and use the macro rather than a comment. Depending on how many bugs this would enable find (perhaps some experiments are in order?), I could be convinced the tradeoff is worthwhile.</blockquote>
<div><br></div><div>I believe Alex has already gone through the hits from this diagnostic; see the fallthrough-bugs-llvm.diff patch attached to the original mail on this thread for the bugs he found.</div><div><br></div><div>
Alex: can you tell us how many FALLTHROUGH annotations would be required, and how many bugs you found, when running this over LLVM and Clang?</div></div>