summaryrefslogtreecommitdiff
path: root/src/pulsecore
diff options
context:
space:
mode:
authorPeter Meerwald-Stadler <pmeerw@pmeerw.net>2017-03-06 08:15:29 +0100
committerPeter Meerwald-Stadler <pmeerw@pmeerw.net>2017-03-06 08:22:33 +0100
commit424e97a5fa56de8a1f7b87ff8fda66059cd1a0fc (patch)
treef5a282cb76895c58ea0430acc8f5a497a0804c25 /src/pulsecore
parente368ee4875bf21d1115a70ea4a548690a42672be (diff)
build: Add Coverity scan model
the modeling file help to avoid false positives and increase scanning accuracy by explaining code Coverity can't see (out of tree libraries); the model file must be uploaded by an admin to: https://scan.coverity.com/projects/pulseaudio?tab=analysis_settings the pa_assert_se() macro needs to be rewritten for Coverity so that the assignment is not declared a side-effect Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Diffstat (limited to 'src/pulsecore')
-rw-r--r--src/pulsecore/macro.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pulsecore/macro.h b/src/pulsecore/macro.h
index 2c5d5f28..dbce5cd0 100644
--- a/src/pulsecore/macro.h
+++ b/src/pulsecore/macro.h
@@ -186,6 +186,7 @@ static inline size_t PA_ALIGN(size_t l) {
/* pa_assert_se() is an assert which guarantees side effects of x,
* i.e. is never optimized away, regardless of NDEBUG or FASTPATH. */
+#ifndef __COVERITY__
#define pa_assert_se(expr) \
do { \
if (PA_UNLIKELY(!(expr))) { \
@@ -193,6 +194,14 @@ static inline size_t PA_ALIGN(size_t l) {
abort(); \
} \
} while (false)
+#else
+#define pa_assert_se(expr) \
+ do { \
+ int _unique_var = (expr); \
+ if (!_unique_var) \
+ abort(); \
+ } while (false)
+#endif
/* Does exactly nothing */
#define pa_nop() do {} while (false)