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.