]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/c-common.c
tree.h (CASE_LOW_SEEN, [...]): New macros for manipulating temporary visit flags...
authorRoger Sayle <roger@eyesopen.com>
Sat, 26 Aug 2006 23:51:14 +0000 (23:51 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sat, 26 Aug 2006 23:51:14 +0000 (23:51 +0000)
commitc782c2fed844c4e6e1ea4944866e166ae69fcae2
tree69dba2343ca72d778fac60a1c90248608167d71f
parent52ccd5770a6d24a8b13e51817d4f1ba38b8528c6
tree.h (CASE_LOW_SEEN, [...]): New macros for manipulating temporary visit flags on CASE_LABEL_EXPRs.

* tree.h (CASE_LOW_SEEN, CASE_HIGH_SEEN): New macros for manipulating
temporary visit flags on CASE_LABEL_EXPRs.
* c-common.c (match_case_to_enum): Add function comment.  Avoid
O(N) loop, by looking up both CASE_LOW_SEEN and CASE_HIGH_SEEN.
(c_do_switch_warnings):  Reorganize to record CASE_LOW_SEEN and
CASE_HIGH_SEEN for enumerated types.  If the switch expression is
a constant, only warn if that constant value isn't handled.

* gcc.dg/Wswitch-enum-2.c: New test case.
* gcc.dg/Wswitch-enum-3.c: Likewise.

From-SVN: r116481
gcc/ChangeLog
gcc/c-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Wswitch-enum-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wswitch-enum-3.c [new file with mode: 0644]
gcc/tree.h