public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* kernel/rcutree.c:2850:13: warning: array subscript is above array bounds
@ 2012-11-29 13:47 Markus Trippelsdorf
  2012-11-29 17:02 ` Paul E. McKenney
  0 siblings, 1 reply; 8+ messages in thread
From: Markus Trippelsdorf @ 2012-11-29 13:47 UTC (permalink / raw)
  To: paulmck; +Cc: linux-kernel

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-11-29 20:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-29 13:47 kernel/rcutree.c:2850:13: warning: array subscript is above array bounds Markus Trippelsdorf
2012-11-29 17:02 ` Paul E. McKenney
2012-11-29 17:43   ` Markus Trippelsdorf
2012-11-29 18:10     ` Paul E. McKenney
2012-11-29 18:22       ` Markus Trippelsdorf
2012-11-29 19:19         ` Paul E. McKenney
2012-11-29 20:03           ` Markus Trippelsdorf
2012-11-29 20:25             ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox