summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2021-08-30 06:02:47 +0200
committerWilly Tarreau <w@1wt.eu>2021-08-30 09:39:24 +0200
commit1b306bf364c6ad66c37f03bf6f5b7c1714408abb (patch)
treeccb13276825b06c2dd2c5cf251c4b2ceed315e3e
parentb131049eb5ba5b0e7c02eea10ce9763da4428abe (diff)
downloadhaproxy-20210830-wundef-1.tar.gz
BUILD: globally enable -Wundef20210830-wundef-1
As seen in issue #1369, supporting #if with unknown macros can silently hide typos that may result in suboptimal code paths to be used, or even possibly bugs. It looks like our code base does not rely that much on this, so it's worth enabling -Wundef to catch future ones and have them turned to more explicit "#if defined()" or #ifdef.
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 9a3c8bcd2..d0a7862b6 100644
--- a/Makefile
+++ b/Makefile
@@ -191,7 +191,7 @@ REG_TEST_SCRIPT=./scripts/run-regtests.sh
# 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 := -Wall -Wextra -Wdeclaration-after-statement
+SPEC_CFLAGS := -Wall -Wextra -Wundef -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)