From a4f82f917a9b0802b70cd80c21d2e53688e2b9b3 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 12 Mar 2016 10:11:03 -0800 Subject: Use do { ... } while(0) idiom to make debug() macro safer Cleans up several -Wempty-body warnings from gcc 5.3 Signed-off-by: Alan Coopersmith Reviewed-by: Adam Jackson --- def.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'def.h') diff --git a/def.h b/def.h index 1930cde..59670a9 100644 --- a/def.h +++ b/def.h @@ -82,9 +82,9 @@ extern int _debugmask; * 3 show #include SYMBOL * 4-6 unused */ -#define debug(level,arg) { if (_debugmask & (1 << level)) warning arg; } +#define debug(level,arg) do { if (_debugmask & (1 << level)) warning arg; } while(0) #else -#define debug(level,arg) /**/ +#define debug(level,arg) do { /**/ } while (0) #endif /* DEBUG */ typedef unsigned char boolean; -- cgit v1.2.3