From owner-freebsd-arch@FreeBSD.ORG Sun Feb 5 15:55:48 2006 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9657716A420; Sun, 5 Feb 2006 15:55:48 +0000 (GMT) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.183]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8645943D48; Sun, 5 Feb 2006 15:55:47 +0000 (GMT) (envelope-from max@love2party.net) Received: from [84.163.254.207] (helo=amd64.laiers.local) by mrelayeu.kundenserver.de (node=mrelayeu1) with ESMTP (Nemesis), id 0MKwpI-1F5mEj1vLf-0006zT; Sun, 05 Feb 2006 16:55:38 +0100 From: Max Laier Organization: FreeBSD To: "M. Warner Losh" Date: Sun, 5 Feb 2006 16:56:57 +0100 User-Agent: KMail/1.9.1 References: <20060204211357.GD7604@ip.net.ua> <20060204.155856.39766510.imp@bsdimp.com> <20060205084813.GN21806@wombat.fafoe.narf.at> In-Reply-To: <20060205084813.GN21806@wombat.fafoe.narf.at> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2221331.id6B1i7EH1"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200602051657.06224.max@love2party.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de login:61c499deaeeba3ba5be80f48ecc83056 Cc: des@des.no, Stefan Farfeleder , freebsd-arch@freebsd.org Subject: Re: [releng_6 tinderbox] failure on sparc64/sparc64 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2006 15:55:48 -0000 --nextPart2221331.id6B1i7EH1 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sunday 05 February 2006 09:48, Stefan Farfeleder wrote: > On Sat, Feb 04, 2006 at 03:58:56PM -0700, M. Warner Losh wrote: > > This driver wants to access these structures as arrays of uint32_t. > > It used to cast directly, but that isn't allowed. So, I've passed > > the cast through a (void *). Is that allowed? Eg: > > > > struct foo foo; > > ((uint32_t *)(void *)&foo)[3] =3D 12; > > > > is that OK? > > I'm afraid that only silences the warning without solving the underlying > problem. I don't think there's a Standard conforming way to treat a > struct foo as an uint32_t array. You could embed the original struct contents with an uint32_t array in an=20 union. That way you don't even have to cast. e.g.: struct foo { union { struct foo_orig { field1; field2; } orig; uint32_t array[SIZE]; } wrap; #define field1 wrap.orig.field1 #define field2 wrap.orig.field2 }; You should obviously make sure that the fields are named uniquely and the=20 header is private to you. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart2221331.id6B1i7EH1 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQBD5iBSXyyEoT62BG0RAjqVAJ9RTT6uq28fZJonsL/m6tHgrGRTFQCdGZ5h 3I+Fc5f8wAk89tmqE9IwXxk= =FiKF -----END PGP SIGNATURE----- --nextPart2221331.id6B1i7EH1--