diff options
author | Andrew Cagney <ac131313@redhat.com> | 2002-03-26 15:36:37 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@gcc.gnu.org> | 2002-03-26 15:36:37 +0000 |
commit | 173028e5ab8009adf8df8c023ed7a9d71328fe3d (patch) | |
tree | 94846cf8b81e58eaebeff467b95dc20837930bef /gcc/stmt.c | |
parent | e14365a7382302adc4144d493bbbb28275e467fc (diff) | |
download | gcc-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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); |