[cfe-commits] r164083 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDecl.cpp test/Sema/warn-duplicate-enum.c test/SemaCXX/warn-unique-enum.cpp
Ted Kremenek
kremenek at apple.com
Tue Sep 18 10:07:35 PDT 2012
No, not really. But I wouldn't mind it going in as an opt-in checker. I just don't think it is generally applicable.
In the compiler, I could possibly see tying this warning to an attribute one could apply to an enum decl, indicating that all the values should be unique. That would allow users a way to opt into this checking.
On Sep 18, 2012, at 7:47 AM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> On Tue, Sep 18, 2012 at 3:41 AM, Ted Kremenek <kremenek at apple.com> wrote:
>> Author: kremenek
>> Date: Mon Sep 17 19:41:42 2012
>> New Revision: 164083
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=164083&view=rev
>> Log:
>> Per discussion on cfe-dev, remove -Wunique-enums entirely. There
>> is no compelling argument that this is a generally useful warning,
>> and imposes a strong stylistic argument on code beyond what it was
>> intended to find warnings in.
>
> Do you see value in adding this as a non-path-sensitive check to
> static analyzer?
>
> Dmitri
>
> --
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
More information about the cfe-commits
mailing list