aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorDirk Mueller <dmueller@suse.de>2007-01-18 13:00:33 +0000
committerDirk Mueller <mueller@gcc.gnu.org>2007-01-18 13:00:33 +0000
commit590b1f2d1f60b909e45e9b47f8a3e71a608dee20 (patch)
tree2d86bde5e9f2aefe4b2d4556eac1f4327318abb4 /gcc/doc
parenteedeea04da0bbdf7e975a31c9c55f3929657b909 (diff)
downloadgcc-590b1f2d1f60b909e45e9b47f8a3e71a608dee20.zip
gcc-590b1f2d1f60b909e45e9b47f8a3e71a608dee20.tar.gz
gcc-590b1f2d1f60b909e45e9b47f8a3e71a608dee20.tar.bz2
· Richard Guenther <rguenther@suse.de>
2007-01-18 Dirk Mueller <dmueller@suse.de> · Richard Guenther <rguenther@suse.de> · PR diagnostic/8268 · * doc/invoke.texi (Warray-bounds): Document -Warray-bounds. · * common.opt (Warray-bounds): Add new warning option. · * c-opts.c (c_common_handle_option): Define -Warray-bounds · if -Wall is given. * Makefile.in: make tree-vrp.o depend on toplev.h · * tree-vrp.c (vrp_finalize): Call check_array_refs if -Warray-bounds · is enabled. · (check_array_refs, check_array_bounds, check_array_ref): New. · * gcc.dg/Warray-bounds.c: New testcase. * gcc.dg/Warray-bounds-2.c: New testcase. * g++.dg/warn/Warray-bounds.C: New testcase. * g++.dg/warn/Warray-bounds-2.C: New testcase. From-SVN: r120898
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/invoke.texi11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index b896aa5..3447ff8 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -222,8 +222,8 @@ Objective-C and Objective-C++ Dialects}.
@item Warning Options
@xref{Warning Options,,Options to Request or Suppress Warnings}.
@gccoptlist{-fsyntax-only -pedantic -pedantic-errors @gol
--w -Wextra -Wall -Waggregate-return -Walways-true -Wno-attributes @gol
--Wc++-compat -Wcast-align -Wcast-qual -Wchar-subscripts @gol
+-w -Wextra -Wall -Waggregate-return -Walways-true -Warray-bounds @gol
+-Wno-attributes -Wc++-compat -Wcast-align -Wcast-qual -Wchar-subscripts @gol
-Wclobbered -Wcomment @gol
-Wconversion -Wno-deprecated-declarations @gol
-Wdisabled-optimization -Wno-div-by-zero @gol
@@ -2842,6 +2842,13 @@ compiler is using for optimization. This warning catches more cases than
@option{-Wstrict-aliasing}, but it will also give a warning for some ambiguous
cases that are safe.
+@item -Warray-bounds
+@opindex Wno-array-bounds
+@opindex Warray-bounds
+This option is only active when @option{-ftree-vrp} is active
+(default for -O2 and above). It warns about subscripts to arrays
+that are always out of bounds. This warning is enabled by @option{-Wall}.
+
@item -Wall
@opindex Wall
All of the above @samp{-W} options combined. This enables all the