Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 04 Feb 2006 15:58:56 -0700 (MST)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        des@des.no
Cc:        arch@FreeBSD.org
Subject:   Re: [releng_6 tinderbox] failure on sparc64/sparc64
Message-ID:  <20060204.155856.39766510.imp@bsdimp.com>
In-Reply-To: <86fymyn5il.fsf@xps.des.no>
References:  <20060204211357.GD7604@ip.net.ua> <20060204.143353.109955782.imp@bsdimp.com> <86fymyn5il.fsf@xps.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <86fymyn5il.fsf@xps.des.no>
            des@des.no (Dag-Erling Sm=F8rgrav) writes:
: "M. Warner Losh" <imp@bsdimp.com> writes:
: > Ruslan Ermilov <ru@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 coul=
d
: 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 thi=
s, but
  I'll not update them until these changes can be reviewed by the pedan=
tic
  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] =3D 12;

is that OK?

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060204.155856.39766510.imp>