From 590b1f2d1f60b909e45e9b47f8a3e71a608dee20 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 18 Jan 2007 13:00:33 +0000 Subject: =?UTF-8?q?=C2=B7=20Richard=20Guenther=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2007-01-18 Dirk Mueller · Richard Guenther · 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 --- gcc/doc/invoke.texi | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'gcc/doc') 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 -- cgit v1.1