aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-10-12 01:19:06 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-10-12 01:19:06 +0200
commit70f6d5e19bb7c0eed9f3fc028632405b5c166676 (patch)
tree07eca0bd2785dbe7d4080d868f53c82033d3cef3 /gcc/gimplify.c
parent4803de58c5fc0f260fe63cedbdfcd4091d136fbf (diff)
downloadgcc-70f6d5e19bb7c0eed9f3fc028632405b5c166676.zip
gcc-70f6d5e19bb7c0eed9f3fc028632405b5c166676.tar.gz
gcc-70f6d5e19bb7c0eed9f3fc028632405b5c166676.tar.bz2
gcc/
* common.opt (Wimplicit-fallthrough) Turn into alias to -Wimplicit-fallthrough=3. Remove EnabledBy. (Wimplicit-fallthrough=): New option. * gimplify.c (warn_implicit_fallthrough_r): Use OPT_Wimplicit_fallthrough_ instead of OPT_Wimplicit_fallthrough. * doc/invoke.texi (-Wimplicit-fallthrough): Document as alias to -Wimplicit-fallthrough=3. (-Wimplicit-fallthrough=): Document. gcc/c-family/ * c.opt (Wextra): Add as C/C++/ObjC/ObjC++ option. (Wimplicit-fallthrough=): Enable for these languages by -Wextra. * c-opts.c (sanitize_cpp_opts): Initialize cpp_opts->cpp_warn_implicit_fallthrough. gcc/testsuite/ * c-c++-common/Wimplicit-fallthrough-25.c: New test. * c-c++-common/Wimplicit-fallthrough-26.c: New test. * c-c++-common/Wimplicit-fallthrough-27.c: New test. * c-c++-common/Wimplicit-fallthrough-28.c: New test. * c-c++-common/Wimplicit-fallthrough-29.c: New test. * c-c++-common/Wimplicit-fallthrough-30.c: New test. * c-c++-common/Wimplicit-fallthrough-31.c: New test. * c-c++-common/Wimplicit-fallthrough-32.c: New test. * c-c++-common/Wimplicit-fallthrough-33.c: New test. libcpp/ * include/cpplib.h (struct cpp_options): Add cpp_warn_implicit_fallthrough. * init.c (cpp_create_reader): Initialize it to 0. * lex.c (fallthrough_comment_p): Handle different cpp_warn_implicit_fallthrough levels. Whitespace fixes. From-SVN: r241013
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 0b1a0be..2f074f9 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -1918,7 +1918,7 @@ warn_implicit_fallthrough_r (gimple_stmt_iterator *gsi_p, bool *handled_ops_p,
else if (gimple_code (prev) == GIMPLE_LABEL
&& (label = gimple_label_label (as_a <glabel *> (prev)))
&& (l = find_label_entry (&labels, label)))
- warned_p = warning_at (l->loc, OPT_Wimplicit_fallthrough,
+ warned_p = warning_at (l->loc, OPT_Wimplicit_fallthrough_,
"this statement may fall through");
else if (!gimple_call_internal_p (prev, IFN_FALLTHROUGH)
/* Try to be clever and don't warn when the statement
@@ -1926,7 +1926,7 @@ warn_implicit_fallthrough_r (gimple_stmt_iterator *gsi_p, bool *handled_ops_p,
&& gimple_stmt_may_fallthru (prev)
&& gimple_has_location (prev))
warned_p = warning_at (gimple_location (prev),
- OPT_Wimplicit_fallthrough,
+ OPT_Wimplicit_fallthrough_,
"this statement may fall through");
if (warned_p)
inform (gimple_location (next), "here");