diff options
author | Marek Polacek <mpolacek@gcc.gnu.org> | 2014-06-03 17:35:34 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2014-06-03 17:35:34 +0000 |
commit | fedfecef5e3e78daf0d970d8edb4ab33a167535c (patch) | |
tree | 91bf428ee9f7a6bf677d0b5faa7d6cf778b29135 /gcc/c/c-tree.h | |
parent | e4f36438a9dd49f88a9fb4006b481aeeda780255 (diff) | |
download | gcc-fedfecef5e3e78daf0d970d8edb4ab33a167535c.zip gcc-fedfecef5e3e78daf0d970d8edb4ab33a167535c.tar.gz gcc-fedfecef5e3e78daf0d970d8edb4ab33a167535c.tar.bz2 |
re PR c/60439 (No warning for case overflow in switch statement.)
PR c/60439
* doc/invoke.texi: Document -Wswitch-bool.
* function.c (stack_protect_epilogue): Cast controlling expression of
the switch to int.
* gengtype.c (walk_type): Generate switch expression with its
controlling expression cast to int.
c/
* c-parser.c (c_parser_switch_statement): Pass explicit_cast_p to
c_start_case.
* c-tree.h (c_start_case): Update.
* c-typeck.c (c_start_case): Add new boolean parameter. Warn if
switch condition has boolean value.
cp/
* semantics.c (finish_switch_cond): Warn if switch condition has
boolean value.
c-family/
* c.opt (Wswitch-bool): New option.
testsuite/
* c-c++-common/pr60439.c: New test.
* g++.dg/eh/scope1.C (f4): Add dg-warning.
From-SVN: r211194
Diffstat (limited to 'gcc/c/c-tree.h')
-rw-r--r-- | gcc/c/c-tree.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/c/c-tree.h b/gcc/c/c-tree.h index e7dcb35..133930f 100644 --- a/gcc/c/c-tree.h +++ b/gcc/c/c-tree.h @@ -614,7 +614,7 @@ extern void process_init_element (location_t, struct c_expr, bool, struct obstack *); extern tree build_compound_literal (location_t, tree, tree, bool); extern void check_compound_literal_type (location_t, struct c_type_name *); -extern tree c_start_case (location_t, location_t, tree); +extern tree c_start_case (location_t, location_t, tree, bool); extern void c_finish_case (tree); extern tree build_asm_expr (location_t, tree, tree, tree, tree, tree, bool); extern tree build_asm_stmt (tree, tree); |