BUILD: introduce possibility to define ABORT_NOW() conditionally
code analysis tools recognize abort() better, so let us introduce such possibility
This commit is contained in:
parent
adf6b977ce
commit
4a034f2212
1
Makefile
1
Makefile
@ -106,6 +106,7 @@
|
||||
# SUBVERS : add a sub-version (eg: platform, model, ...).
|
||||
# VERDATE : force haproxy's release date.
|
||||
# VTEST_PROGRAM : location of the vtest program to run reg-tests.
|
||||
# DEBUG_USE_ABORT: use abort() for program termination, see include/haproxy/bug.h for details
|
||||
|
||||
# verbosity: pass V=1 for verbose shell invocation
|
||||
V = 0
|
||||
|
@ -37,10 +37,15 @@
|
||||
#define DPRINTF(x...)
|
||||
#endif
|
||||
|
||||
/* This abort is more efficient than abort() because it does not mangle the
|
||||
* stack and stops at the exact location we need.
|
||||
*/
|
||||
#ifdef DEBUG_USE_ABORT
|
||||
/* abort() is better recognized by code analysis tools */
|
||||
#define ABORT_NOW() abort()
|
||||
#else
|
||||
/* More efficient than abort() because it does not mangle the
|
||||
* stack and stops at the exact location we need.
|
||||
*/
|
||||
#define ABORT_NOW() (*(volatile int*)1=0)
|
||||
#endif
|
||||
|
||||
/* BUG_ON: complains if <cond> is true when DEBUG_STRICT or DEBUG_STRICT_NOCRASH
|
||||
* are set, does nothing otherwise. With DEBUG_STRICT in addition it immediately
|
||||
|
Loading…
x
Reference in New Issue
Block a user