aboutsummaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authorAndrew Cagney <ac131313@redhat.com>2002-03-26 15:36:37 +0000
committerAndrew Cagney <cagney@gcc.gnu.org>2002-03-26 15:36:37 +0000
commit173028e5ab8009adf8df8c023ed7a9d71328fe3d (patch)
tree94846cf8b81e58eaebeff467b95dc20837930bef /gcc/stmt.c
parente14365a7382302adc4144d493bbbb28275e467fc (diff)
downloadgcc-173028e5ab8009adf8df8c023ed7a9d71328fe3d.zip
gcc-173028e5ab8009adf8df8c023ed7a9d71328fe3d.tar.gz
gcc-173028e5ab8009adf8df8c023ed7a9d71328fe3d.tar.bz2
Add -Wswitch-enum. Document.
Fix PR c/5044. From-SVN: r51386
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 5823f8b..fcda52d 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -5280,10 +5280,10 @@ expand_end_case_type (orig_index, orig_type)
{
/* If the switch expression was an enumerated type, check that
exactly all enumeration literals are covered by the cases.
- The check is made -Wswitch was specified and there is no
- default case. */
-
- if ((warn_switch && !thiscase->data.case_stmt.default_label)
+ The check is made when -Wswitch was specified and there is no
+ default case, or when -Wswitch-enum was specified. */
+ if (((warn_switch && !thiscase->data.case_stmt.default_label)
+ || warn_switch_enum)
&& TREE_CODE (orig_type) == ENUMERAL_TYPE
&& TREE_CODE (index_expr) != INTEGER_CST)
check_for_full_enumeration_handling (orig_type);