From b70981532a517cf5845bf1e96a8eaefaa0e1a2eb Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 10 Apr 2024 09:02:28 +0200 Subject: [PATCH] BUILD: debug: make DEBUG_STRICT=1 the default We continue to carry it in the makefile, which adds to the difficulty of passing new options. Let's make DEBUG_STRICT=1 the default so that one has to explicitly pass DEBUG_STRICT=0 to disable it. This allows us to remove the option from the default DEBUG variable in the makefile. --- INSTALL | 4 ++-- Makefile | 2 +- include/haproxy/defaults.h | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/INSTALL b/INSTALL index 1268f2351..56e459631 100644 --- a/INSTALL +++ b/INSTALL @@ -658,8 +658,8 @@ these options should not be changed. Among the usable ones are: conditions are not met, and whose violation will result in a misbehaving process due to memory corruption or other significant trouble, possibly caused by an attempt to exploit a bug in the program or a library it relies - on. The option knows 3 values: 0 (disable all such assertions, the default - when the option is not set), 1 (enable all inexpensive assertions), and + on. The option knows 3 values: 0 (disable all such assertions, not + recommended), 1 (enable all inexpensive assertions, the default), and 2 (enable all assertions even in fast paths). Setting the option with no value corresponds to 1, which is the recommended value for production. diff --git a/Makefile b/Makefile index 76b6cfa6b..888b3d7a3 100644 --- a/Makefile +++ b/Makefile @@ -228,7 +228,7 @@ SMALL_OPTS = # DEBUG_NO_POOLS, DEBUG_FAIL_ALLOC, DEBUG_STRICT_ACTION=[0-3], DEBUG_HPACK, # DEBUG_AUTH, DEBUG_SPOE, DEBUG_UAF, DEBUG_THREAD, DEBUG_STRICT, DEBUG_DEV, # DEBUG_TASK, DEBUG_MEMORY_POOLS, DEBUG_POOL_TRACING, DEBUG_QPACK, DEBUG_LIST. -DEBUG = -DDEBUG_STRICT -DDEBUG_MEMORY_POOLS +DEBUG = -DDEBUG_MEMORY_POOLS #### Trace options # Use TRACE=1 to trace function calls to file "trace.out" or to stderr if not diff --git a/include/haproxy/defaults.h b/include/haproxy/defaults.h index bcb63e6cd..c0cb9f34b 100644 --- a/include/haproxy/defaults.h +++ b/include/haproxy/defaults.h @@ -556,4 +556,9 @@ # define RING_DFLT_QUEUES 6 #endif +/* Let's make DEBUG_STRICT default to 1 to get rid of it in the makefile */ +#ifndef DEBUG_STRICT +# define DEBUG_STRICT 1 +#endif + #endif /* _HAPROXY_DEFAULTS_H */