mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-15 07:52:14 +02:00
DEBUG: rename WARN_ON_ONCE() to CHECK_IF()
The only reason for warning once is to check if a condition really happens. Let's use a term that better translates the intent, that's important when reading the code.
This commit is contained in:
@@ -113,15 +113,15 @@
|
||||
#if defined(DEBUG_STRICT)
|
||||
#define BUG_ON(cond) _BUG_ON (cond, __FILE__, __LINE__, 3, "FATAL: bug ", "")
|
||||
#define WARN_ON(cond) _BUG_ON (cond, __FILE__, __LINE__, 0, "WARNING: ", " (please report to developers)")
|
||||
#define WARN_ON_ONCE(cond) _BUG_ON_ONCE(cond, __FILE__, __LINE__, 0, "WARNING: ", " (please report to developers)")
|
||||
#define CHECK_IF(cond) _BUG_ON_ONCE(cond, __FILE__, __LINE__, 0, "WARNING: ", " (please report to developers)")
|
||||
#elif defined(DEBUG_STRICT_NOCRASH)
|
||||
#define BUG_ON(cond) _BUG_ON (cond, __FILE__, __LINE__, 2, "FATAL: bug ", " (not crashing but process is untrusted now)")
|
||||
#define WARN_ON(cond) _BUG_ON (cond, __FILE__, __LINE__, 0, "WARNING: ", " (please report to developers)")
|
||||
#define WARN_ON_ONCE(cond) _BUG_ON_ONCE(cond, __FILE__, __LINE__, 0, "WARNING: ", " (please report to developers)")
|
||||
#define CHECK_IF(cond) _BUG_ON_ONCE(cond, __FILE__, __LINE__, 0, "WARNING: ", " (please report to developers)")
|
||||
#else
|
||||
#define BUG_ON(cond)
|
||||
#define WARN_ON(cond)
|
||||
#define WARN_ON_ONCE(cond)
|
||||
#define CHECK_IF(cond)
|
||||
#endif
|
||||
|
||||
/* When not optimizing, clang won't remove that code, so only compile it in when optimizing */
|
||||
|
||||
Reference in New Issue
Block a user