kernel/rcutree.c:2850:13: warning: array subscript is above arraybounds

From: Markus Trippelsdorf
Date: Thu Nov 29 2012 - 08:47:56 EST


With gcc-4.8 I get:

CC kernel/rcutree.o
kernel/rcutree.c: In function ârcu_init_oneâ:
kernel/rcutree.c:2850:13: warning: array subscript is above array bounds [-Warray-bounds]
rsp->level[i] = rsp->level[i - 1] + rsp->levelcnt[i - 1];
^
2849 for (i = 1; i < rcu_num_lvls; i++)
2850 rsp->level[i] = rsp->level[i - 1] + rsp->levelcnt[i - 1];

At first I thought that the warning was bogus, but rcu_num_lvls isn't static
and gets modified prior to the for loop.

--
Markus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/