summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2015-10-19 21:11:15 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2015-10-19 22:39:53 -0400
commit3e94db236fe47538aae8fbdf31e6f321188c09a0 (patch)
tree0adbf01bb379082f044b5caa247aea8892f5695f
parentd39e0fc0a8a7982ea2e9c66de06e3df28bed950e (diff)
downloadperl-3e94db236fe47538aae8fbdf31e6f321188c09a0.tar.gz
Make __ASSERT__() empty under Coverity, avoiding many false alerts.
(As suggested by khw.)
-rw-r--r--handy.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/handy.h b/handy.h
index ffb8e2fc3d..79e9cfd366 100644
--- a/handy.h
+++ b/handy.h
@@ -280,8 +280,13 @@ typedef U64TYPE U64;
/* This is a helper macro to avoid preprocessor issues, replaced by nothing
* unless under DEBUGGING, where it expands to an assert of its argument,
* followed by a comma (hence the comma operator). If we just used a straight
- * assert(), we would get a comma with nothing before it when not DEBUGGING */
-#ifdef DEBUGGING
+ * assert(), we would get a comma with nothing before it when not DEBUGGING.
+ *
+ * We also use empty definition under Coverity since the __ASSERT__
+ * checks often check for things that Really Cannot Happen, and Coverity
+ * detects that and gets all excited. */
+
+#if defined(DEBUGGING) && !defined(__COVERITY__)
# define __ASSERT_(statement) assert(statement),
#else
# define __ASSERT_(statement)