From 3e94db236fe47538aae8fbdf31e6f321188c09a0 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Mon, 19 Oct 2015 21:11:15 -0400 Subject: Make __ASSERT__() empty under Coverity, avoiding many false alerts. (As suggested by khw.) --- handy.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'handy.h') 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) -- cgit v1.2.1