[winpr,assert] coverity suppress CONSTANT_EXPRESSION_RESULT
This commit is contained in:
parent
1520d94d33
commit
c5711f0a2e
@ -34,19 +34,21 @@
|
|||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
#define WINPR_ASSERT(cond) \
|
#define WINPR_ASSERT(cond) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
WINPR_PRAGMA_DIAG_PUSH \
|
WINPR_PRAGMA_DIAG_PUSH \
|
||||||
WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE \
|
WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE \
|
||||||
WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE \
|
WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE \
|
||||||
WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS \
|
WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS \
|
||||||
WINPR_DO_PRAGMA(coverity compliance deviate "NO_EFFECT:SUPPRESS" \
|
WINPR_DO_PRAGMA(coverity compliance deviate "NO_EFFECT:SUPPRESS" \
|
||||||
"WINPR_ASSERT") \
|
"WINPR_ASSERT") \
|
||||||
\
|
WINPR_DO_PRAGMA(coverity compliance deviate "CONSTANT_EXPRESSION_RESULT:SUPPRESS" \
|
||||||
if (!(cond)) \
|
"WINPR_ASSERT") \
|
||||||
winpr_int_assert(#cond, __FILE__, __func__, __LINE__); \
|
\
|
||||||
WINPR_PRAGMA_DIAG_POP \
|
if (!(cond)) \
|
||||||
|
winpr_int_assert(#cond, __FILE__, __func__, __LINE__); \
|
||||||
|
WINPR_PRAGMA_DIAG_POP \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
static INLINE WINPR_NORETURN(void winpr_int_assert(const char* condstr, const char* file,
|
static INLINE WINPR_NORETURN(void winpr_int_assert(const char* condstr, const char* file,
|
||||||
@ -63,17 +65,19 @@ extern "C"
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define WINPR_ASSERT(cond) \
|
#define WINPR_ASSERT(cond) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
WINPR_PRAGMA_DIAG_PUSH \
|
WINPR_PRAGMA_DIAG_PUSH \
|
||||||
WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE \
|
WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE \
|
||||||
WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE \
|
WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE \
|
||||||
WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS \
|
WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS \
|
||||||
WINPR_DO_PRAGMA(coverity compliance deviate "NO_EFFECT:SUPPRESS" \
|
WINPR_DO_PRAGMA(coverity compliance deviate "NO_EFFECT:SUPPRESS" \
|
||||||
"WINPR_ASSERT") \
|
"WINPR_ASSERT") \
|
||||||
assert(cond); \
|
WINPR_DO_PRAGMA(coverity compliance deviate "CONSTANT_EXPRESSION_RESULT:SUPPRESS" \
|
||||||
WINPR_PRAGMA_DIAG_POP \
|
"WINPR_ASSERT") \
|
||||||
|
assert(cond); \
|
||||||
|
WINPR_PRAGMA_DIAG_POP \
|
||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user