From a6ba3ad626ccd15f9104b3143c297f39cce6e050 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 22 Aug 2017 18:19:12 +0200 Subject: src: remove ifdef DEBUG pollution Get rid of lots of ifdef DEBUG pollution in the code. The --debug= option is useful to get feedback from users, so it should be always there. And we really save nothing from keeping this code away from the control plane with a compile time option. Just running tests/shell/ before and after this patch, time shows almost no difference. So this patch leaves --enable-debug around to add debugging symbols in your builds, this is left set on by default. Signed-off-by: Pablo Neira Ayuso --- include/utils.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'include') diff --git a/include/utils.h b/include/utils.h index 0605eeed..36919524 100644 --- a/include/utils.h +++ b/include/utils.h @@ -13,17 +13,9 @@ #define BITS_PER_BYTE 8 -#if defined(DEBUG) #define pr_debug(fmt, arg...) printf(fmt, ##arg) -#else -#define pr_debug(fmt, arg...) ({ if (false) {}; 0; }) -#endif -#if defined(DEBUG) && defined(HAVE_LIBGMP) #define pr_gmp_debug(fmt, arg...) gmp_printf(fmt, ##arg) -#else -#define pr_gmp_debug(fmt, arg...) ({ if (false) {}; 0; }) -#endif #define __fmtstring(x, y) __attribute__((format(printf, x, y))) #if 0 @@ -35,11 +27,7 @@ #define __must_check __attribute__((warn_unused_result)) #define __noreturn __attribute__((__noreturn__)) -#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) -- cgit v1.2.3