[cfe-commits] [PATCH] "missing else" warning

Nico Weber thakis at chromium.org
Fri Jan 18 10:49:15 PST 2013


On Fri, Jan 18, 2013 at 10:41 AM, Alexander Zinenko <ftynse at gmail.com> wrote:
> Hi!
>
> I implemented a warning in parser as suggested here
> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121217/159766.html,
> e.g. warn in the following case
> if () {
> } if () { // probably should have been 'else if'
> } else {
> }
>
> Please review!
>
> This diagnostic found two places in chromium

Can you link to these? I thought I grepped chromium's source for "}
if" after this thread and found 2 occurrences in WebKit (both false
positives, and both now fixed). Where the ones you found in WebKit
too? If so, then the true positive rate for this diagnostic is 0 / 2.

> and another one in firefox
> source base that are suspicious to have missed else.

Was this a true positive?

>
> By the way, there is a name clash between
> Parser::ParenParseOption::CompoundStmt and CompoundStmt from AST.  Maybe the
> former is worth renaming?
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>



More information about the cfe-commits mailing list