This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][RFC] Add a subset of -Warray-bounds warnings to C/C++ front ends
- From: Simon Baldwin <simonb at google dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Guenther <richard dot guenther at gmail dot com>, Dirk Mueller <dmuell at gmx dot net>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Thu, 01 May 2008 12:07:02 -0700
- Subject: Re: [PATCH][RFC] Add a subset of -Warray-bounds warnings to C/C++ front ends
- References: <20080404000715.3C75741AB58@localhost> <84fc9c000804040241l98b2f6esd052290fa66b4303@mail.gmail.com> <47FBC58A.5020702@codesourcery.com> <47FFC01A.6050000@google.com> <48124DC3.5080508@google.com> <4813CC38.40907@codesourcery.com>
Thanks all. Committed, with suggested doc/invoke.texi change, as
revision 134865.
Mark Mitchell wrote:
Simon Baldwin wrote:
Thanks to a well targeted pointer from Tom Tromey, I've now added the
extra logic to suppress warnings about "sizeof(a[-1])" in the C and
C++ frontends. Attached is the revised version.
Thanks for following up. I think this is a worthwhile patch.
+This option performs a subset of checks in unoptimized compilations,
and
+stricter checking when @option{-ftree-vrp} is active
(default for -O2 and above).
I think "stricter" could be made more explicit. How about something
like:
This option detects some cases of out-of-bounds accesses in
unoptimized compilations. More cases are detected when
@option{-ftree-vrp} is enabled. (The @option{-ftree-vrp} option is
enabled automatically when compiling with @option{-O2} or higher
optimization options.)
Joseph, do you have any comments on the C changes? Simon, if you do
not hear otherwise from Joseph within 72 hours, this patch is OK.
Thanks,