BUILD: globally enable -Wundef

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.
This commit is contained in:
Willy Tarreau 2021-08-30 06:02:47 +02:00
parent 7b2108cad1
commit 28e295d92c
1 changed files with 1 additions and 1 deletions

View File

@ -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)