BUILD: makefile: add -Wfatal-errors to the default flags

Some error reports are misleading on some recent versions of gcc because
it goes on to build for a very long time after it meets an error. Not
only this makes it hard to scroll back to the beginning of the error,
but it also hides the cause of the error when it's prominently printed
in a "#error" statement. This typically happens when building with QUIC
and without OPENSSL where there can be 4 pages of unknown types and such
errors after the "Must define USE_OPENSSL" suggestion.

The flag -Wfatal-errors serves exactly this purpose, to stop after the
first error, and it's supported on all the compilers we support, so let's
enable this now.
This commit is contained in:
Willy Tarreau 2022-05-11 11:32:41 +02:00
parent ff3333e658
commit 6d868a2c65

View File

@ -219,7 +219,7 @@ REG_TEST_SCRIPT=./scripts/run-regtests.sh
# to be sure we get the intended behavior. # to be sure we get the intended behavior.
WARN_CFLAGS := -Wtype-limits -Wshift-negative-value -Wshift-overflow=2 \ WARN_CFLAGS := -Wtype-limits -Wshift-negative-value -Wshift-overflow=2 \
-Wduplicated-cond -Wnull-dereference -Wduplicated-cond -Wnull-dereference
SPEC_CFLAGS := -Wall -Wextra -Wundef -Wdeclaration-after-statement SPEC_CFLAGS := -Wall -Wextra -Wundef -Wdeclaration-after-statement -Wfatal-errors
SPEC_CFLAGS += $(call cc-all-fast,$(WARN_CFLAGS)) SPEC_CFLAGS += $(call cc-all-fast,$(WARN_CFLAGS))
SPEC_CFLAGS += $(call cc-opt-alt,-fwrapv,-fno-strict-overflow) SPEC_CFLAGS += $(call cc-opt-alt,-fwrapv,-fno-strict-overflow)