Make setting of CFLAGS_NOSTRICT make sense 88/11988/4
authorBenjamin Kaduk <kaduk@mit.edu>
Thu, 20 Aug 2015 17:55:02 +0000 (13:55 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Wed, 4 May 2016 23:58:38 +0000 (19:58 -0400)
commit687b4d8af07dbcf187dea685e75b420884727efd
treebc5abe68f7869726b84bec58ef9fbca9288e164e
parentbc123573539084ffc5a16ef1efaaaced5b2be202
Make setting of CFLAGS_NOSTRICT make sense

Previously, we would set -fno-strict-aliasing only when
--enable-checking was given to configure but not
--enable-checking=all.  The intent seems to have been to
only warn about strict aliasing violations when --enable-checking=all
is in use, but that there was no need to disable the strict-aliasing
diagnostics when -Werror was not enabled.

Unfortunately, -fno-strict-aliasing affects not only the diagnostics
emitted by the compiler, but also the code generation!  So we were
leaving the normal (no --enable-checking) case with the compiler
assuming C's strict aliasing rules.  The OpenAFS codebase has
historically not been strict-aliasing safe (for example,
commit 15e8678661ec49f5eac3954defad84c06b3e0164 refers to a
runtime crash using a certain compiler version, which is diagnosed
as the compiler using the C strict aliasing rules to make
optimizations that exposed the invalid program code.

To avoid futher surprises due to new compiler optimizations
that utilize the C strict aliasing rules, always disable
strict aliasing except when --enable-checking=all is used.

Change-Id: Ib5d3bbd7c88686bd9a878b6b2c5e7c2b4eeccc04
Reviewed-on: https://gerrit.openafs.org/11988
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/cf/osconf.m4