[cfe-dev] clang++: '-Wswitch-enum' turned on by default
Chris Lattner
clattner at apple.com
Thu Sep 16 10:11:01 PDT 2010
On Sep 16, 2010, at 9:27 AM, Douglas Gregor wrote:
>>
>> t.c:4:11: warning: enumeration value 'a' not handled in switch [-Wswitch-enum]
>> switch (a) {
>> ^
>> t.c:4:11: warning: enumeration value 'd' not handled in switch [-Wswitch-enum]
>> t.c:4:11: warning: enumeration value 'e' not handled in switch [-Wswitch-enum]
>> t.c:4:11: warning: enumeration value 'f' not handled in switch [-Wswitch-enum]
>> t.c:4:11: warning: enumeration value 'g' not handled in switch [-Wswitch-enum]
>> 5 warnings generated.
>>
>> In this case, I think it would be better to emit one warning say:
>>
>> t.c:4:11: warning: 5 enumeration values not handled in switch: 'a', 'd', 'e' ... [-Wswitch-enum]
>>
>> or something like that. What do you think?
>
> I think that's an excellent idea.
Done in r114093.
-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100916/04a75774/attachment.html>
More information about the cfe-dev
mailing list