The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Markus Trippelsdorf <markus@trippelsdorf.de>
To: paulmck@linux.vnet.ibm.com
Cc: linux-kernel@vger.kernel.org
Subject: kernel/rcutree.c:2850:13: warning: array subscript is above array bounds
Date: Thu, 29 Nov 2012 14:47:52 +0100	[thread overview]
Message-ID: <20121129134752.GB219@x4> (raw)

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

             reply	other threads:[~2012-11-29 13:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-29 13:47 Markus Trippelsdorf [this message]
2012-11-29 17:02 ` kernel/rcutree.c:2850:13: warning: array subscript is above array bounds 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121129134752.GB219@x4 \
    --to=markus@trippelsdorf.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox