From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel De Graaf Subject: Re: xen-unstable stubdom build-failure when debug=n Date: Mon, 21 Jul 2014 14:13:25 -0400 Message-ID: <53CD5845.9090400@tycho.nsa.gov> References: <223502494.20140717102731@eikelenboom.it> <1405606391.1977.6.camel@kazak.uk.xensource.com> <598019223.20140717162519@eikelenboom.it> <1405959204.13494.0.camel@kazak.uk.xensource.com> <1405959873.13494.8.camel@kazak.uk.xensource.com> <20140721174327.GA5544@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X9I5x-0004of-9G for xen-devel@lists.xenproject.org; Mon, 21 Jul 2014 18:13:53 +0000 In-Reply-To: <20140721174327.GA5544@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Olaf Hering , Ian Campbell Cc: Sander Eikelenboom , stefano.stabellini@eu.citrix.com, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On 07/21/2014 01:43 PM, Olaf Hering wrote: > On Mon, Jul 21, Ian Campbell wrote: > >> tpm_tis.c:618:71: error: array subscript is below array bounds [-Werror=array-bounds] >> >> Line 618 does appear to include the use of a signed variable as an array >> offset, but I'm not sure how or why gcc is proving that it is negative. > > It can not prove that tpm->locality remains positive. > > Olaf In that case, shouldn't the error be phrased less severely (something like "might be below array bounds")? Anyway, the actual value is checked by locality_enabled prior to the array access, and that check is effectively (0x1F & (1 << locality)), limiting the actual value to 0..4. I can't reproduce the warning with my version of GCC, so I'm only looking at the code, but it looks like GCC is being overly conservative after not detecting the range limit and this is just a false positive. -- Daniel De Graaf National Security Agency