[cfe-dev] -Wunique-enum; is it worth it?

Matt Beaumont-Gay matthewbg at google.com
Thu Sep 13 13:20:28 PDT 2012


On Thu, Sep 13, 2012 at 12:59 PM, Ted Kremenek <kremenek at apple.com> wrote:
> On Sep 12, 2012, at 3:55 PM, Douglas Gregor <dgregor at apple.com> wrote:
>
> I don't think this warning belongs in Clang at all, even under
> DefaultIgnore. The false positive rate is far too high for it to be useful
> for the majority of users, and it isn't the kind of warning that maps well
> to DefaultIgnore, because it doesn't correspond to some stylistic decision
> or usage pattern…. it's just too noisy for the majority of users.
>
>
> I agree.  This seems highly stylistic and not generally applicable.  Unless
> there are objections, I will remove this warning entirely tomorrow.  I think
> it was a good experiment, but I don't see the general payoff here.

The false positive rate for this warning in under-development code at
Google is pretty low, one FP in 14 cases in August. Most of the true
positives come from generated code in protocol buffers -- enumerators
in protobufs must all have explicit values, so copy-and-paste leads to
wrongly duplicated values.

-Matt




More information about the cfe-dev mailing list