[releng_6 tinderbox] failure on sparc64/sparc64

M. Warner Losh imp at bsdimp.com
Sat Feb 4 15:00:10 PST 2006


In message: <86fymyn5il.fsf at xps.des.no>
            des at des.no (Dag-Erling Smørgrav) writes:
: "M. Warner Losh" <imp at bsdimp.com> writes:
: > Ruslan Ermilov <ru at FreeBSD.org> writes:
: > > I mean, I don't see a reason not to remove -fno-strict-aliasing
: > > from the kernel builds now.  Perhaps it's still needed for some
: > > platforms that aren't covered by tinderbox, not sure...  Can be
: > > easily checked with "make universe".
: 
: First of all, the kernel Makefiles contain a hack which force
: -fno-strict-aliasing whether you want it or not.
: 
: Second, the kernel will *not* build without -fno-strict-aliasing,
: partly because of preexisting aliasing violations and partly because
: of aliasing violations which were introduced after the hack (and could
: have been avoided if that hack had not been in place).
: 
: > There's a dozen or two files that will fail to compile -O2 w/o it
: > spread through the tree.
: 
: not throughout the tree - only in the kernel.

That's what I ment.

I've made some changes.  Some of which I'm pretty sure of, the other
I'm less sure of.  I've made the following changes:

imp         2006-02-04 22:51:03 UTC

  FreeBSD src repository

  Modified files:
    sys/dev/an           if_an.c 
  Log:
  Silence the strict-alias warnings.  Make a trip through (void *) when
  casting a structure to a uint32_t *.  Many drivers in the tree do this, but
  I'll not update them until these changes can be reviewed by the pedantic
  standards folks.
  
  Revision  Changes    Path
  1.78      +16 -16    src/sys/dev/an/if_an.c

http://cvsweb.FreeBSD.ORG/src/sys/dev/an/if_an.c


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?

Warner


More information about the freebsd-arch mailing list