This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH/middle-end/diagnostic] Do not warn about unused out of bounds array refs
On Tue, Mar 20, 2007 at 05:32:59PM +0100, Dirk Mueller wrote:
> On Tuesday, 20. March 2007, Richard Guenther wrote:
> > I still would prefer you'd warn at dereference or escape sites only
> > (escape sites
> > are possible dereference sites).
> That would disable warnings about taking addresses of array references that
> are out of bounds. Right?
If you never dereference such a pointer and it doesn't escape.
int foo (void)
char *p = &a; // This wouldn't warn
char *q = &a;
*q = 5; // We would warn here
r = &a[-1]; // and here as well
But if you never dereference it and it doesn't escape, then it is completely
As is -Warray-bounds just causes too many false positives, see
PR31227 or e.g. yesterday when I tried to bootstrap with obj-c++
among --enable-languages trunk didn't bootstrap because of it either.