Re: False positive from -Warray-bounds?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Vincent Lefevre <vincent+gcc@xxxxxxxxxx> writes:

> The -Warray-bounds warning occurs with:
>
> void t(unsigned int s)
> {
>     arr1[f(s)] = 0;
>     arr1[f(s)] = 0;
> }
>
> but not with:
>
> void t(unsigned int s)
> {
>     arr1[f(s)] = 0;
> }
>
> If "The warning triggers if there is some code path in which the index
> is provably out of bounds." is the intended behavior (assuming that
> the warning phrasing isn't really correct), isn't this proof the same
> one in both cases? Why this difference in the gcc behavior?

Sounds like a bug somewhere to me.

The -Warray-bounds option is definitely optimization dependent, which is
a flaw.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux