diff options
author | root <root@debian.localnet> | 2012-12-08 18:08:44 +0100 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2012-12-08 18:11:20 +0100 |
commit | 47ff571046570e8f70f545de162e09c2ff147f80 (patch) | |
tree | 177823218da0ae77ce0514d60ee77e845c74eade /include | |
parent | 84792b4813a4ebf59e546acfac80144775e0d47e (diff) |
debug: include verbose message in all BUG statements
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/utils.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/utils.h b/include/utils.h index 15271e5b..854986f2 100644 --- a/include/utils.h +++ b/include/utils.h @@ -30,7 +30,11 @@ #define __must_check __attribute__((warn_unused_result)) #define __noreturn __attribute__((__noreturn__)) -#define BUG() assert(0) +#ifdef DEBUG +#define BUG(fmt, arg...) ({ fprintf(stderr, "BUG: " fmt, ##arg); assert(0); }) +#else +#define BUG(fmt, arg...) assert(0) +#endif #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) #define BUILD_BUG_ON_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1) |