]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: makefile: re-enable strict aliasing
authorWilly Tarreau <w@1wt.eu>
Tue, 25 Feb 2020 09:10:47 +0000 (10:10 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 25 Feb 2020 09:24:51 +0000 (10:24 +0100)
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

index 8f8119a14c427f50d20586edf7ca214119120d43..1e6b3841ccad81cd928801cadb2e4722cb9df400 100644 (file)
--- 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)