From d1c847abbc3c26fc8dd1dd0624bf8a26e045e8ed Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 25 Feb 2020 10:10:47 +0100 Subject: [PATCH] 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. --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8f8119a14..1e6b3841c 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)