[cfe-commits] r150055 - in /cfe/trunk: include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td test/Sema/switch.c

Ted Kremenek kremenek at apple.com
Wed Feb 8 20:40:38 PST 2012


On Feb 8, 2012, at 5:25 PM, Chandler Carruth <chandlerc at google.com> wrote:

> While we have some good evidence that there is a better pattern (the one this warning pushes people toward), but there is a considerable amount of code that currently follows one of the old patterns.
> 
> To me, the question of whether we should try to drive code toward a single style through a -Wall should be answered by looking at how buggy the existing patterns are, and how frequently they are followed. For code I've looked at, this warning occurs fairly frequently, and has found few or no bugs. For code I've looked at, the converse pattern added to -Wparentheses fired fairly infrequently, and in a reasonable number of cases found bugs.
> 
> Given that, I think -Wcovered-switch-default is useful to folks who are willing to switch coding patterns to one we can defend against future bugs, but I fear it has too high of a "falso positive" from people who are satisfied with finding related bugs via 'abort()' or 'assert()' or whatever to place under -Wall.
> 

Thanks so much for the perspective.  I completely agree with these points, which was part of my original motivation for pulling this warning out of -Wall.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120208/63aab8d9/attachment.html>


More information about the cfe-commits mailing list