From: Willy Tarreau Date: Tue, 25 Feb 2020 09:10:47 +0000 (+0100) Subject: BUILD: makefile: re-enable strict aliasing X-Git-Tag: v2.2-dev3~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1c847abbc3c26fc8dd1dd0624bf8a26e045e8ed;p=thirdparty%2Fhaproxy.git BUILD: makefile: re-enable strict aliasing For a very long time we've used to build without strict aliasing due to very few places in the stick-tables code mostly, that initially we didn't know how to deal with. The problem of doing this is that it encourages to write possibly incorrect code such as the few SSL sample fetch functions that were recently fixed. All places causing aliasing errors on x86_64, i586, armv8, armv7 and mips were fixed so it's about time to re-enable the warning hoping to catch such errors early in the development cycle. As a bonus, this removed about 5kB of code. --- diff --git a/Makefile b/Makefile index 8f8119a14c..1e6b3841cc 100644 --- a/Makefile +++ b/Makefile @@ -176,12 +176,11 @@ REG_TEST_FILES = REG_TEST_SCRIPT=./scripts/run-regtests.sh #### Compiler-specific flags that may be used to disable some negative over- -# optimization or to silence some warnings. -fno-strict-aliasing is needed with -# gcc >= 4.4. +# optimization or to silence some warnings. # We rely on signed integer wraparound on overflow, however clang think it # can do whatever it wants since it's an undefined behavior, so use -fwrapv # to be sure we get the intended behavior. -SPEC_CFLAGS := -fno-strict-aliasing -Wdeclaration-after-statement +SPEC_CFLAGS := -Wdeclaration-after-statement SPEC_CFLAGS += $(call cc-opt-alt,-fwrapv,$(call cc-opt,-fno-strict-overflow)) SPEC_CFLAGS += $(call cc-nowarn,address-of-packed-member) SPEC_CFLAGS += $(call cc-nowarn,unused-label)