diff --git a/INSTALL b/INSTALL index e10822d23..1a1da4d15 100644 --- a/INSTALL +++ b/INSTALL @@ -665,7 +665,10 @@ way to get a usable core when you need one. Otherwise, you can set DEBUG to If the ERR variable is set to any non-empty value other than "0", then -Werror will be added to the compiler so that any build warning will trigger an error. This is the recommended way to build when developing, and it is expected that -contributed patches were tested with ERR=1. +contributed patches were tested with ERR=1. Similarly, for developers, another +variable, FAILFAST enables -Wfatal-errors when set to non-empty except 0, and +makes the compiler stop at the first error instead of scrolling pages. It's +essentially a matter of taste. The DEBUG variable is used to extend the CFLAGS and is preset to a list of build-time options that are known for providing significant reliability diff --git a/Makefile b/Makefile index 8fe5c8e1b..4c3d3c51d 100644 --- a/Makefile +++ b/Makefile @@ -82,6 +82,7 @@ # DEP may be cleared to ignore changes to include files during development # DEBUG may be used to set some internal debugging options. # ERR may be set to non-empty to pass -Werror to the compiler +# FAILFAST may be set to non-empty to pass -Wfatal-errors to the compiler # ADDINC may be used to complete the include path in the form -Ipath. # ADDLIB may be used to complete the library list in the form -Lpath -llib. # DEFINE may be used to specify any additional define, which will be reported @@ -205,7 +206,7 @@ STD_CFLAGS := $(call cc-opt-alt,-fwrapv,-fno-strict-overflow) #### Compiler-specific flags to enable/disable certain classes of warnings. WARN_CFLAGS := -Wtype-limits -Wshift-negative-value -Wshift-overflow=2 \ -Wduplicated-cond -Wnull-dereference -SPEC_CFLAGS := -Wall -Wextra -Wundef -Wdeclaration-after-statement -Wfatal-errors +SPEC_CFLAGS := -Wall -Wextra -Wundef -Wdeclaration-after-statement SPEC_CFLAGS += $(call cc-all-fast,$(WARN_CFLAGS)) SPEC_CFLAGS += $(cc-wnouwo) @@ -223,6 +224,10 @@ ifneq ($(ERR:0=),) SPEC_CFLAGS += -Werror endif +ifneq ($(FAILFAST:0=),) + SPEC_CFLAGS += -Wfatal-errors +endif + #### No longer used SMALL_OPTS = ifneq ($(SMALL_OPTS),)