diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-10-09 13:07:15 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-10-22 09:32:13 -0400 |
commit | c77f57d37bbea4e7281c2de95a9f19b885290111 (patch) | |
tree | f5dfa02b13303f5b7145de87c604d07fd92cec8a /src/lib | |
parent | fb4b6b64360659d7f9807fe9284cf3eab2e64ff3 (diff) | |
download | tor-c77f57d37bbea4e7281c2de95a9f19b885290111.tar.gz tor-c77f57d37bbea4e7281c2de95a9f19b885290111.zip |
util_bug.h: Coccinelle does not understand IF_BUG_ONCE or #nodef.
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/log/util_bug.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/log/util_bug.h b/src/lib/log/util_bug.h index 546ae1e3ef..8c233da735 100644 --- a/src/lib/log/util_bug.h +++ b/src/lib/log/util_bug.h @@ -131,7 +131,9 @@ #undef BUG // Coverity defines this in global headers; let's override it. This is a // magic coverity-only preprocessor thing. +#ifndef COCCI #nodef BUG(x) (x) +#endif #endif /* defined(__COVERITY__) */ #if defined(__COVERITY__) || defined(__clang_analyzer__) @@ -200,6 +202,7 @@ : 0) #endif /* defined(ALL_BUGS_ARE_FATAL) || ... */ +#ifndef COCCI #ifdef __GNUC__ #define IF_BUG_ONCE__(cond,var) \ if (( { \ @@ -208,7 +211,7 @@ if (bool_result && !var) { \ var = 1; \ tor_bug_occurred_(SHORT_FILE__, __LINE__, __func__, \ - "!("#cond")", 1, NULL); \ + ("!("#cond")"), 1, NULL); \ } \ bool_result; } )) #else /* !(defined(__GNUC__)) */ @@ -218,10 +221,12 @@ (var ? 1 : \ (var=1, \ tor_bug_occurred_(SHORT_FILE__, __LINE__, __func__, \ - "!("#cond")", 1, NULL), \ + ("!("#cond")"), 1, NULL), \ 1)) \ : 0) #endif /* defined(__GNUC__) */ +#endif + #define IF_BUG_ONCE_VARNAME_(a) \ warning_logged_on_ ## a ## __ #define IF_BUG_ONCE_VARNAME__(a) \ |