]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: makefile: make the ERR variable also support 0
authorWilly Tarreau <w@1wt.eu>
Thu, 11 Apr 2024 13:03:12 +0000 (15:03 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Apr 2024 15:33:28 +0000 (17:33 +0200)
It's among the options that change a lot on the developer's side and it's
tempting to change from ERR=1 to ERR=0 on the make command line by reusing
the history, except it doesn't work. Let's explictily permit ERR=0 to
disable -Werror like ERR= does.

INSTALL
Makefile

diff --git a/INSTALL b/INSTALL
index 2e15c8398a66e1e6ec08aa9b3893e8f8c7c8f544..e10822d232dcb8e3e615002f3e6a29936222e82e 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -662,10 +662,10 @@ It is not wise to disable it on uncommon systems, because it's often the only
 way to get a usable core when you need one. Otherwise, you can set DEBUG to
 '-s' to strip the binary.
 
-If the ERR variable is set to any non-empty value, 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.
+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.
 
 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
index af4a04a49d5b4e6a6126e93e9f46d7af39801f64..8fe5c8e1bf13de174f2b8986f9509b955e6dd4b5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -219,7 +219,7 @@ SPEC_CFLAGS += $(call cc-nowarn,cast-function-type)
 SPEC_CFLAGS += $(call cc-nowarn,string-plus-int)
 SPEC_CFLAGS += $(call cc-nowarn,atomic-alignment)
 
-ifneq ($(ERR),)
+ifneq ($(ERR:0=),)
   SPEC_CFLAGS += -Werror
 endif