diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-10-12 01:19:06 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-10-12 01:19:06 +0200 |
commit | 70f6d5e19bb7c0eed9f3fc028632405b5c166676 (patch) | |
tree | 07eca0bd2785dbe7d4080d868f53c82033d3cef3 /libcpp/init.c | |
parent | 4803de58c5fc0f260fe63cedbdfcd4091d136fbf (diff) | |
download | gcc-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 'libcpp/init.c')
-rw-r--r-- | libcpp/init.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libcpp/init.c b/libcpp/init.c index 2df8cfb..5e35280 100644 --- a/libcpp/init.c +++ b/libcpp/init.c @@ -189,6 +189,7 @@ cpp_create_reader (enum c_lang lang, cpp_hash_table *table, CPP_OPTION (pfile, warn_dollars) = 1; CPP_OPTION (pfile, warn_variadic_macros) = 1; CPP_OPTION (pfile, warn_builtin_macro_redefined) = 1; + CPP_OPTION (pfile, cpp_warn_implicit_fallthrough) = 0; /* By default, track locations of tokens resulting from macro expansion. The '2' means, track the locations with the highest accuracy. Read the comments for struct |