aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2015-12-10 17:16:32 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2015-12-10 10:16:32 -0700
commit0da4edf76dfca5d4ea7af4ddfdbe944229d71cc5 (patch)
treef18765a9a8a3d3135e7ff375d946187d730796a2 /gcc
parent3dec93d59c389bcb17830dad1e191775c4b45eed (diff)
downloadgcc-0da4edf76dfca5d4ea7af4ddfdbe944229d71cc5.zip
gcc-0da4edf76dfca5d4ea7af4ddfdbe944229d71cc5.tar.gz
gcc-0da4edf76dfca5d4ea7af4ddfdbe944229d71cc5.tar.bz2
invoke.texi (Warning Options): Update -Wall options.
* invoke.texi (Warning Options): Update -Wall options. Clarify when some -Wextra options are enabled. Add -Wplacement-new example. From-SVN: r231533
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/doc/invoke.texi33
2 files changed, 27 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a8bbe3d..2eb367a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-12-10 Martin Sebor <msebor@redhat.com>
+
+ * invoke.texi (Warning Options): Update -Wall options. Clarify
+ when some -Wextra options are enabled. Add -Wplacement-new example.
+
2015-12-10 Uros Bizjak <ubizjak@gmail.com>
PR tree-optimization/68619
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 3cddf5c..3f87429 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -3542,18 +3542,22 @@ Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
@gccoptlist{-Waddress @gol
-Warray-bounds=1 @r{(only with} @option{-O2}@r{)} @gol
+-Wbool-compare @gol
-Wc++11-compat -Wc++14-compat@gol
-Wchar-subscripts @gol
+-Wcomment @gol
-Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
+-Wformat @gol
+-Wimplicit @r{(C and Objective-C only)} @gol
-Wimplicit-int @r{(C and Objective-C only)} @gol
-Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
--Wbool-compare @gol
--Wduplicated-cond @gol
--Wcomment @gol
--Wformat @gol
+-Winit-self @r{(only for C++)} @gol
+-Wlogical-not-parentheses
-Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)} @gol
-Wmaybe-uninitialized @gol
+-Wmemset-transposed-args @gol
-Wmissing-braces @r{(only for C/ObjC)} @gol
+-Wnarrowing @r{(only for C++)} @gol
-Wnonnull @gol
-Wopenmp-simd @gol
-Wparentheses @gol
@@ -3562,6 +3566,7 @@ Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
-Wreturn-type @gol
-Wsequence-point @gol
-Wsign-compare @r{(only in C++)} @gol
+-Wsizeof-pointer-memaccess @gol
-Wstrict-aliasing @gol
-Wstrict-overflow=1 @gol
-Wswitch @gol
@@ -3599,10 +3604,10 @@ name is still supported, but the newer name is more descriptive.)
-Wmissing-parameter-type @r{(C only)} @gol
-Wold-style-declaration @r{(C only)} @gol
-Woverride-init @gol
--Wsign-compare @gol
+-Wsign-compare @r{(C only)} @gol
-Wtype-limits @gol
-Wuninitialized @gol
--Wshift-negative-value @gol
+-Wshift-negative-value @r{(in C++03 and in C99 and newer)} @gol
-Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
-Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
}
@@ -4589,7 +4594,6 @@ warn for the following code:
if (p->q != NULL) @{ @dots{} @}
else if (p->q != NULL) @{ @dots{} @}
@end smallexample
-This warning is enabled by @option{-Wall}.
@item -Wframe-address
@opindex Wno-frame-address
@@ -4896,8 +4900,15 @@ which depend on the MS runtime.
@opindex Wno-placement-new
Warn about placement new expressions with undefined behavior, such as
constructing an object in a buffer that is smaller than the type of
-the object.
-
+the object. For example, the placement new expression below is diagnosed
+because it attempts to construct an array of 64 integers in a buffer only
+64 bytes large.
+@smallexample
+char buf [64];
+new (buf) int[64];
+@end smallexample
+This warning is enabled by default.
+
@item -Wpointer-arith
@opindex Wpointer-arith
@opindex Wno-pointer-arith
@@ -5114,8 +5125,8 @@ can be disabled with the @option{-Wno-jump-misses-init} option.
@cindex signed and unsigned values, comparison warning
Warn when a comparison between signed and unsigned values could produce
an incorrect result when the signed value is converted to unsigned.
-This warning is also enabled by @option{-Wextra}; to get the other warnings
-of @option{-Wextra} without this warning, use @option{-Wextra -Wno-sign-compare}.
+In C++, this warning is also enabled by @option{-Wall}. In C, it is
+also enabled by @option{-Wextra}.
@item -Wsign-conversion
@opindex Wsign-conversion