Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Nov 2007 15:38:22 -0800
From:      "Kip Macy" <kip.macy@gmail.com>
To:        "John Birrell" <jb@what-creek.com>,  "John Merryweather Cooper" <john_m_cooper@yahoo.com>,  "????????? Bill Hacker" <askbill@conducive.net>,  freebsd-current@freebsd.org
Subject:   Re: Tinderbox
Message-ID:  <b1fa29170711201538t17662ae7r76d95450ef68fd15@mail.gmail.com>
In-Reply-To: <20071120231938.GA13120@owl.midgard.homeip.net>
References:  <543425.44000.qm@web50704.mail.re2.yahoo.com> <20071120224337.GB12810@what-creek.com> <20071120231938.GA13120@owl.midgard.homeip.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Nov 20, 2007 3:19 PM, Erik Trulsson <ertr1013@student.uu.se> wrote:
> On Tue, Nov 20, 2007 at 10:43:37PM +0000, John Birrell wrote:
> > On Tue, Nov 20, 2007 at 07:35:42AM -0800, John Merryweather Cooper wrote:
> > > Could not -fno-strict-aliasing be considered as just another WARN level?
> > > At least then, there might be some pressure to eliminate strict aliasing
> > > warnings as a necessary component to moving to a higher WARN level.
> > >
> >
> > This is something I'd like to do right now as "a step in the right
> > direction".
> >
> > RCS file: /u/freebsd/cvsup/src/src/share/mk/bsd.sys.mk,v
> > retrieving revision 1.43
> > diff -r1.43 bsd.sys.mk
> > 11,12d10
> > < NO_WERROR=
> > <
> > 78a77,80
> > > .if defined(NO_WARNS) || (defined(WARNS) && ${WARNS} == 0)
> > > CFLAGS                +=      -fno-strict-aliasing
> > > .endif
> > >
> >
> >
> > and remove it from the default CFLAGS in sys.mk
> >
>
> You seem to misunderstand what -fno-strict-aliasing does.
> Its purpose is not to disable some warnings, but to disable
> certain optimizations which can easily cause not-quite-correct code
> to behave differently than the programmer intended.
> Such incorrect code is unfortunately fairly common, which is why
> -fno-strict-aliasing is often needed.
>
> Which optimizations are enabled or disabled should not depend
> on which WARN level is used.
>
> If gcc gives a warning about strict aliasing this means that there is
> almost certainly a bug in the code which need to be fixed, to make it safe
> to compile with the extra optimizations that an assumption of strict
> aliasing enables.
>

The kernel will never be compiled with strict aliasing on. It
introduces the possibility for too many impossible to diagnose bugs.

 -Kip



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