[cfe-commits] Removing redundant default cases

David Blaikie dblaikie at gmail.com
Fri Sep 23 19:20:10 PDT 2011


I hacked up a cheap version of a warning for defaults in switches that
already cover all cases in an enum (the warning is in excess_default.diff -
given some discussion with Chandler on IRC I don't think we consider this to
be sufficiently high quality to be checked in, but I wouldn't mind some
other opinions/thoughts (the issue was that it might need to use the CFG to
ensure that it's not reachable via loops nested in the switch or gotos,
fallthroughs etc)) and I found/fixed the following cases
(excess_default_fixes.diff)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110923/6c814b4d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: excess_default.diff
Type: application/octet-stream
Size: 1514 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110923/6c814b4d/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: excess_default_fixes.diff
Type: application/octet-stream
Size: 17285 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110923/6c814b4d/attachment-0001.obj>


More information about the cfe-commits mailing list