2009/3/5 Jack Howarth :
>
> Manuel,
> It seems that the simplier testcase must be optimizing away the loop
> at all optimization levels. Are there any options that would suppress that
> optimization if one was just looking for array bounds errors with
> -Warray-bounds?
>
On Thu, Mar 05, 2009 at 10:05:15AM +0100, Manuel López-Ibáñez wrote:
> 2009/3/5 Dave Korn :
> >
> > of an array that only has size[4] is going one past the end. So the bug is
> > the missing warning for the simplified testcase, not that the warning is
> > somehow incorrect in the more complex one.
2009/3/5 Dave Korn :
>
> of an array that only has size[4] is going one past the end. So the bug is
> the missing warning for the simplified testcase, not that the warning is
> somehow incorrect in the more complex one.
No. The array is unused so it gets removed quite early. If you *do*
return th
Jack Howarth wrote:
> Dave,
> My original guess was that as well, however when I tried a simplier test
> case of...
>
> #define CMD_QUEUE_MASK 0x3
> void test()
> {
> int cmdQueue[CMD_QUEUE_MASK+1];
>
> int a;
>
> for(a=0;a<=CMD_QUEUE_MASK;a++)
> ;
> cmdQueue[a] = 0;
>
On Thu, Mar 05, 2009 at 03:56:18AM +, Dave Korn wrote:
> Jack Howarth wrote:
>
> > Ortho.c: In function 'OrthoFree':
> > Ortho.c:1973: warning: array subscript is above array bounds
>
> > #define CMD_QUEUE_MASK 0x3
>
> >CQueue *cmdQueue[CMD_QUEUE_MASK+1];
>
> > int a;
> >
> > f
Jack Howarth wrote:
> Ortho.c: In function 'OrthoFree':
> Ortho.c:1973: warning: array subscript is above array bounds
> #define CMD_QUEUE_MASK 0x3
>CQueue *cmdQueue[CMD_QUEUE_MASK+1];
> int a;
>
> for(a=0;a<=CMD_QUEUE_MASK;a++)
> ;
> I->cmdQueue[a] = ((void *)0);
> }
>
While compiling the current pymol svn with gcc trunk
I ran across a compilation warning...
Ortho.c: In function 'OrthoFree':
Ortho.c:1973: warning: array subscript is above array bounds
which doesn't seem to make sense. The reduced test case that
triggers it with -O3 -Wall is...
#define CMD_Q