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

Richard Trieu rtrieu at google.com
Wed Sep 12 15:48:33 PDT 2012


On Wed, Sep 12, 2012 at 3:35 PM, Ted Kremenek <kremenek at apple.com> wrote:

> On Sep 12, 2012, at 3:27 PM, Richard Trieu <rtrieu at google.com> wrote:
>
> This warning caught around 5 bugs.  Roughly twice that amount in false
> positives needed to be silenced.
>
>
> Thanks Richard.
>
> IMO, that's a pretty dreadful signal-to-noise ratio.  That's a 66% false
> positive rate.  That's the kind of false positive rate I'd consider a
> warning being DefaultIgnore, not be on by default.  Do the other false
> positives look like cases the warning logic could be improved to handle?
>  Less than 10% false positive rate seems required to me for this warning to
> be on by default.
>

I have no problems with switching this to DefaultIgnore.  Looking back,
through the false positives, it looks like the most common case would be
when the enum is simply there to hold a collection of constants.  I think
checking if there is a variable of the enum type would be the best way to
cut down on false positives, but I am not sure how to go about implementing
that.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120912/574ea62e/attachment.html>


More information about the cfe-dev mailing list