From owner-freebsd-current@FreeBSD.ORG Fri Jan 2 06:30:46 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6ECB9DC; Fri, 2 Jan 2015 06:30:46 +0000 (UTC) Received: from mail.samsco.org (suzy.samsco.org [168.103.85.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 434D064D91; Fri, 2 Jan 2015 06:30:45 +0000 (UTC) Received: from localhost (localhost [192.168.254.3]) by mail.samsco.org (Postfix) with ESMTP id 4C9DB15C1D104; Fri, 2 Jan 2015 06:24:36 +0000 (UTC) Received: from mail.samsco.org ([192.168.254.3]) by localhost (mail.samsco.org [192.168.254.3]) (maiad, port 10024) with ESMTP id 69800-10; Fri, 2 Jan 2015 06:24:36 +0000 (UTC) Received: from [192.168.1.3] (c-69-244-254-154.hsd1.fl.comcast.net [69.244.254.154]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: scottl@samsco.org) by mail.samsco.org (Postfix) with ESMTPSA id B61CE15C1A688; Fri, 2 Jan 2015 06:24:35 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: asr(4) error with new clang/llvm From: Scott Long In-Reply-To: Date: Fri, 2 Jan 2015 01:21:40 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <63EDB2D2-4545-4FE3-85BD-4ED2321BA3C7@samsco.org> References: <54A61AFD.3040507@multiplay.co.uk> To: Ed Maste X-Mailer: Apple Mail (2.1993) Cc: FreeBSD Current , Steven Hartland X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 06:30:46 -0000 > On Jan 2, 2015, at 12:00 AM, Ed Maste wrote: >=20 > On 1 January 2015 at 23:13, Steven Hartland = wrote: >>=20 >> On 02/01/2015 01:23, Bjoern A. Zeeb wrote: >>>=20 >>> Hi, >>>=20 >>> you need the next line of source to see that while the union only = defines >>> Simple[1], the comparison goes up to SG_LIST (or something) which is = indeed >>> defined as 58. Cn someone fix this? This makes i386 compiles = failing >>> currently. >>>=20 >>> = /scratch/tmp/bz/head.svn/sys/modules/asr/../../dev/asr/asr.c:1849:29: >>> error: array index 58 is past the end of the array (which contains 1 >>> element) [-Werror,-Warray-bounds] >>> while ((len > 0) && (sg < = &((PPRIVATE_SCSI_SCB_EXECUTE_MESSAGE) >>> ^ >>> /scratch/tmp/bz/head.svn/sys/dev/asr/i2omsg.h:934:8: note: array = 'Simple' >>> declared here >>> I2O_SGE_SIMPLE_ELEMENT Simple[1]; >>> ^ >>=20 >> If that's wrong it looks like there's also a number of calls to the = macro >> SG(SGL,Index,Flags,Buffer,Size) which are also wrong as Index is = used in >> the same way: >> &(((PI2O_SG_ELEMENT)(SGL))->u.Simple[Index] >>=20 >> There appears to be two calls to SG where Index is 1. >>=20 >> I'm afraid I have no idea what the fix would be as the entire driver = is very >> voodoo like to me :( >=20 > It's a variable length array in a struct / union. Other than being > confusing and now triggering a warning after the clang update it > should be fine. >=20 > Most likely we need to build asr with -Werror disabled for that > warning, perhaps -Wno-error-array-bounds. I'll take a look tomorrow > morning if nobody else gets to it first. >=20 I got to it first ;-) Scott