[SLOF] [PATCH] Fix remaining compiler warnings in sloffs.c

Segher Boessenkool segher at kernel.crashing.org
Mon Aug 8 19:22:58 AEST 2016

On Mon, Aug 08, 2016 at 02:45:35PM +0530, Nikunj A Dadhania wrote:
> >>> In the end, we just might want to add -fno-strict-aliasing to the
> >>> HOSTCFLAGS, just like we already did it in make.rules for the normal
> >>> CFLAGS, and call it a day.
> >> 
> >> Or you could fix the problems.  SLOF used to work with -fstrict-aliasing,
> >> and it was a nice performance win.
> >
> > That's a question for Nikunj who committed that change a couple of years
> > ago ...
> > (see http://git.qemu.org/?p=SLOF.git;a=commitdiff;h=7eca6a5e56f468)
> I remember that we had a discussion on this and BenH had suggested that
> we cannot re-audit all the code for correctness with strict-aliasing. So
> disable it.

That's what -Wstrict-aliasing is for (needs -fstrict-aliasing active as
well, to work).

Rewriting the code to make it better can be quite a bit of work, of
course.  But you could e.g. only use -fno-strict-aliasing on those files
where -Wstrict-aliasing warns.


More information about the SLOF mailing list