Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Jan 2015 01:21:40 -0500
From:      Scott Long <scottl@samsco.org>
To:        Ed Maste <emaste@freebsd.org>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>, Steven Hartland <killing@multiplay.co.uk>
Subject:   Re: asr(4) error with new clang/llvm
Message-ID:  <63EDB2D2-4545-4FE3-85BD-4ED2321BA3C7@samsco.org>
In-Reply-To: <CAPyFy2CHYiss=OtaeS2MJxqfHz_2fF5MNnQuQFc-rK1cB0Wt%2Bw@mail.gmail.com>
References:  <CEA82F51-9D88-4F20-A649-78AE7E5309AA@lists.zabbadoz.net> <54A61AFD.3040507@multiplay.co.uk> <CAPyFy2CHYiss=OtaeS2MJxqfHz_2fF5MNnQuQFc-rK1cB0Wt%2Bw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Jan 2, 2015, at 12:00 AM, Ed Maste <emaste@freebsd.org> wrote:
>=20
> On 1 January 2015 at 23:13, Steven Hartland <killing@multiplay.co.uk> =
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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?63EDB2D2-4545-4FE3-85BD-4ED2321BA3C7>