From owner-freebsd-current@FreeBSD.ORG Fri Jan 2 05:42:02 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 1406EDDC; Fri, 2 Jan 2015 05:42:02 +0000 (UTC) Received: from mail-pa0-x229.google.com (mail-pa0-x229.google.com [IPv6:2607:f8b0:400e:c03::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD04A64865; Fri, 2 Jan 2015 05:42:01 +0000 (UTC) Received: by mail-pa0-f41.google.com with SMTP id rd3so23532863pab.14; Thu, 01 Jan 2015 21:42:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=kwz0/CWOeTY++j1B1mS6J2sLG9BE2vcXH46T3a50U2E=; b=oLt1nA1AdVdqH7B/82PDmmSecOTa/cYNOwiqIRfABABLx6YDMysWK/8kii+TXKHufZ vzoHv8RHm3474VULkA5+27f9PfjxnHr7TdA0296iaAdZhYFjwunmRl1NpVc5sY79ZBJ3 6fLYNSDoYRJI6M0wpV+1xJhkW1vTnZFZU0IwdC+Tw5lhR+Fjc+dFxfsPmssnAIv5D+HX kttpLcRafED1li30iqmmUkFmFRpGRpuRWnmGzhOHGbeDk3b9IeV4rMn5aTpEtxUljUCO sJhHNqjtoHtV0unM3ZL9Q35N0vuNXH+G3KaEqfc6ZDcsXwymWsan3WZtujC7JYKtHa5E FTeg== X-Received: by 10.68.189.233 with SMTP id gl9mr118620512pbc.20.1420177321296; Thu, 01 Jan 2015 21:42:01 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:6d22:f632:3b17:f5d8? ([2601:8:ab80:7d6:6d22:f632:3b17:f5d8]) by mx.google.com with ESMTPSA id wt4sm45653155pab.4.2015.01.01.21.42.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 Jan 2015 21:42:00 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_581D9A34-6C6A-436A-B0F2-FE1213B0038F"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: asr(4) error with new clang/llvm From: Garrett Cooper In-Reply-To: Date: Thu, 1 Jan 2015 21:41:59 -0800 Message-Id: <1617E706-D4A9-4778-BEFB-D943B74B4561@gmail.com> References: <54A61AFD.3040507@multiplay.co.uk> To: Ed Maste X-Mailer: Apple Mail (2.1878.6) Cc: "Bjoern A. Zeeb" , Steven Hartland , Warner Losh , FreeBSD Current 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 05:42:02 -0000 --Apple-Mail=_581D9A34-6C6A-436A-B0F2-FE1213B0038F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Jan 1, 2015, at 21:00, Ed Maste wrote: > 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. It looks like more fallout from bsd.sys.mk being removed from = bad.kmod.mk (NO_WARRAY_BOUNDS should be defined to the appropriate = compiler flag): 1 # $FreeBSD: projects/building-blocks/sys/modules/asr/Makefile 228865 = 2011-12-24 17:54:58Z dim $ 2=20 3 .PATH: ${.CURDIR}/../../dev/asr 4=20 5 KMOD=3D asr 6 SRCS=3D asr.c 7 SRCS+=3D opt_scsi.h opt_cam.h 8 SRCS+=3D device_if.h bus_if.h pci_if.h 9=20 10 .if ${MACHINE_CPUARCH} =3D=3D "i386" 11 SRCS+=3D opt_asr.h 12 .endif 13=20 14 .include 15=20 16 CWARNFLAGS.asr.c=3D ${NO_WARRAY_BOUNDS} 17 CWARNFLAGS+=3D ${CWARNFLAGS.${.IMPSRC:T}} --Apple-Mail=_581D9A34-6C6A-436A-B0F2-FE1213B0038F Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUpi+nAAoJEMZr5QU6S73eepYH/0IfXY/OFei6zoEMToqxOfJu HLE06f4n3dJBJcQIWjXt8HTFMxVxasIQnkqogo1UQ9bWrjKyfoEoCkWuh8CI46N9 bF4qmrTBdFZVAuGU98yXH/whUgx6YUJNFcGW8YnfC51dgv9/q4uBdDdoMEiZ3kZm L5gpwN/8slnh1lzKwCJEk2+MaaE9WJc6EG/wxjsPf2D3txWgMBvM3u71HnPYu7wM 0Ila9POVphAaw4rosGHFsLd73LEPGV/4+7zd+h1mJX41SJoc7iPT7+WUyUy2g5rs EwUen0Lg4ExKG4RtlVIMCJ2vD2NTq/PnZfAT4zx1ClX9pnSOXk1DatIFUNsestY= =WPX+ -----END PGP SIGNATURE----- --Apple-Mail=_581D9A34-6C6A-436A-B0F2-FE1213B0038F--