Re: Infinite loop in dcraw with current GCC versions

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

 



On 1 March 2015 at 21:03,  <dcoffin@xxxxxxxxxxxxxxxxxx> wrote:
>      I fixed all the "undefined behavior" warnings with
> typecasts, but I'm still getting array-bounds warnings
> with manifestly correct code.  E.g. when blend_highlights()
> uses the global variable "colors":
>
>   static const float trans[2][4][4] = { ... }
> ...
>   if ((unsigned) (colors-3) > 1) return;
> ...
>   lab[i][c] += trans[colors-3][c][j] * cam[i][j];
>
>      How could "colors-3" be out of bounds?  I just verified
> that it's either 0 or 1, and if I hard-code 0 or 1 the warning
> goes away.

Could you post a small complete example? It doesn't need to have a
main() function and it is better if it doesn't use any header files.

Cheers,

Manuel.




[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