[releng_6 tinderbox] failure on sparc64/sparc64

Dag-Erling Smørgrav des at des.no
Sun Feb 5 07:45:49 PST 2006


Stefan Farfeleder <stefanf at 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:
> > 
> > 	struct foo foo;
> > 	((uint32_t *)(void *)&foo)[3] = 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.

A union should do the trick.

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the freebsd-arch mailing list