From: Volker Reichelt Date: Thu, 1 Jun 2017 08:10:24 +0000 (+0000) Subject: c.opt (Wcatch-value): New shortcut for Wcatch-value=1. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3fa4634c9250a7e0c51c1eac04d98b2fae032c60;p=gcc.git c.opt (Wcatch-value): New shortcut for Wcatch-value=1. * c.opt (Wcatch-value): New shortcut for Wcatch-value=1. (Wcatch-value=1): Enable by -Wall. * doc/invoke.texi (-Wcatch-value): Document new shortcut. Add to -Wall section. From-SVN: r248772 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9d80f59ce2b..b24b239e557 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-06-01 Volker Reichelt + + * doc/invoke.texi (-Wcatch-value): Document new shortcut. + Add to -Wall section. + 2017-06-01 Richard Biener PR middle-end/66313 diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index a077867c8da..8e163cd2f98 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2017-06-01 Volker Reichelt + + * c.opt (Wcatch-value): New shortcut for Wcatch-value=1. + (Wcatch-value=1): Enable by -Wall. + 2017-05-30 David Malcolm * c-format.c (gcc_cxxdiag_char_table): Add 'H' and 'I' to diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index c3eca4acdeb..a8543ded091 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -388,8 +388,12 @@ Wcast-qual C ObjC C++ ObjC++ Var(warn_cast_qual) Warning Warn about casts which discard qualifiers. +Wcatch-value +C++ ObjC++ Warning Alias(Wcatch-value=, 1, 0) +Warn about catch handlers of non-reference type. + Wcatch-value= -C++ ObjC++ Var(warn_catch_value) Warning Joined RejectNegative UInteger +C++ ObjC++ Var(warn_catch_value) Warning Joined RejectNegative UInteger LangEnabledBy(C++ ObjC++,Wall, 1, 0) Warn about catch handlers of non-reference type. Wchar-subscripts diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 20805df884d..59563aa3d94 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -266,8 +266,8 @@ Objective-C and Objective-C++ Dialects}. -Wno-builtin-declaration-mismatch @gol -Wno-builtin-macro-redefined -Wc90-c99-compat -Wc99-c11-compat @gol -Wc++-compat -Wc++11-compat -Wc++14-compat -Wcast-align -Wcast-qual @gol --Wchar-subscripts -Wchkp -Wcatch-value=@var{n} -Wclobbered -Wcomment @gol --Wconditionally-supported @gol +-Wchar-subscripts -Wchkp -Wcatch-value -Wcatch-value=@var{n} @gol +-Wclobbered -Wcomment -Wconditionally-supported @gol -Wconversion -Wcoverage-mismatch -Wno-cpp -Wdangling-else -Wdate-time @gol -Wdelete-incomplete @gol -Wno-deprecated -Wno-deprecated-declarations -Wno-designated-init @gol @@ -3804,6 +3804,7 @@ Options} and @ref{Objective-C and Objective-C++ Dialect Options}. -Wbool-compare @gol -Wbool-operation @gol -Wc++11-compat -Wc++14-compat @gol +-Wcatch-value @r{(C++ and Objective-C++ only)} @gol -Wchar-subscripts @gol -Wcomment @gol -Wduplicate-decl-specifier @r{(C and Objective-C only)} @gol @@ -5881,13 +5882,16 @@ When compiling C++, warn about the deprecated conversion from string literals to @code{char *}. This warning is enabled by default for C++ programs. -@item -Wcatch-value=@var{n} @r{(C++ and Objective-C++ only)} +@item -Wcatch-value +@itemx -Wcatch-value=@var{n} @r{(C++ and Objective-C++ only)} @opindex Wcatch-value +@opindex Wno-catch-value Warn about catch handlers that do not catch via reference. -With @option{-Wcatch-value=1} warn about polymorphic class types that -are caught by value. With @option{-Wcatch-value=2} warn about all class -types that are caught by value. With @option{-Wcatch-value=3} warn about -all types that are not caught by reference. +With @option{-Wcatch-value=1} (or @option{-Wcatch-value} for short) +warn about polymorphic class types that are caught by value. +With @option{-Wcatch-value=2} warn about all class types that are caught +by value. With @option{-Wcatch-value=3} warn about all types that are +not caught by reference. @option{-Wcatch-value} is enabled by @option{-Wall}. @item -Wclobbered @opindex Wclobbered