Date: Sun, 05 Feb 2006 16:45:34 +0100 From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) To: Stefan Farfeleder <stefanf@FreeBSD.org> Cc: arch@FreeBSD.org Subject: Re: [releng_6 tinderbox] failure on sparc64/sparc64 Message-ID: <867j89n71d.fsf@xps.des.no> In-Reply-To: <20060205084813.GN21806@wombat.fafoe.narf.at> (Stefan Farfeleder's message of "Sun, 5 Feb 2006 09:48:15 %2B0100") References: <20060204211357.GD7604@ip.net.ua> <20060204.143353.109955782.imp@bsdimp.com> <86fymyn5il.fsf@xps.des.no> <20060204.155856.39766510.imp@bsdimp.com> <20060205084813.GN21806@wombat.fafoe.narf.at>
next in thread | previous in thread | raw e-mail | index | archive | help
Stefan Farfeleder <stefanf@FreeBSD.org> writes: > 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: > >=20 > > struct foo foo; > > ((uint32_t *)(void *)&foo)[3] =3D 12; > >=20 > > 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. A union should do the trick. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?867j89n71d.fsf>