diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2016-03-12 10:11:03 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2016-03-27 10:42:24 -0700 |
commit | a4f82f917a9b0802b70cd80c21d2e53688e2b9b3 (patch) | |
tree | fe4072c7c540ff17d345ed2ef2782316ee7e4821 /def.h | |
parent | 9da873c5a036c95aa24a7dc3562d405609262381 (diff) |
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 <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'def.h')
-rw-r--r-- | def.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |