mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
MINOR: abort() on my_unreachable() when DEBUG_USE_ABORT is set.
Hopefully this helps static analysis tools detecting that the code after that call is unreachable. See GitHub Issue #1075.
This commit is contained in:
parent
bde2bf6fd3
commit
3d7f9ff377
@ -66,11 +66,15 @@
|
|||||||
* above which can more aggressively detect null dereferences. The builtin
|
* above which can more aggressively detect null dereferences. The builtin
|
||||||
* below was introduced in gcc 4.5, and before it we didn't care.
|
* below was introduced in gcc 4.5, and before it we didn't care.
|
||||||
*/
|
*/
|
||||||
|
#ifdef DEBUG_USE_ABORT
|
||||||
|
#define my_unreachable() abort()
|
||||||
|
#else
|
||||||
#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
|
#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
|
||||||
#define my_unreachable() __builtin_unreachable()
|
#define my_unreachable() __builtin_unreachable()
|
||||||
#else
|
#else
|
||||||
#define my_unreachable()
|
#define my_unreachable()
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This macro may be used to block constant propagation that lets the compiler
|
/* This macro may be used to block constant propagation that lets the compiler
|
||||||
* detect a possible NULL dereference on a variable resulting from an explicit
|
* detect a possible NULL dereference on a variable resulting from an explicit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user