diff --git a/modules/core/include/opencv2/core/base.hpp b/modules/core/include/opencv2/core/base.hpp index 0342ebde52..389fa65705 100644 --- a/modules/core/include/opencv2/core/base.hpp +++ b/modules/core/include/opencv2/core/base.hpp @@ -414,7 +414,7 @@ CV_INLINE CV_NORETURN void errorNoReturn(int _code, const String& _err, const ch // We need to use simplified definition for them. #define CV_Error(...) do { abort(); } while (0) #define CV_Error_( code, args ) do { cv::format args; abort(); } while (0) -#define CV_Assert_1( expr ) do { if (!(expr)) abort(); } while (0) +#define CV_Assert( expr ) do { if (!(expr)) abort(); } while (0) #else // CV_STATIC_ANALYSIS @@ -473,6 +473,11 @@ configurations while CV_DbgAssert is only retained in the Debug configuration. //! @cond IGNORED +#if defined OPENCV_FORCE_MULTIARG_ASSERT_CHECK && defined CV_STATIC_ANALYSIS +#warning "OPENCV_FORCE_MULTIARG_ASSERT_CHECK can't be used with CV_STATIC_ANALYSIS" +#undef OPENCV_FORCE_MULTIARG_ASSERT_CHECK +#endif + #ifdef OPENCV_FORCE_MULTIARG_ASSERT_CHECK #define CV_Assert_1( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0) #else diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h index c0f76d1654..56403b3191 100644 --- a/modules/core/include/opencv2/core/cvdef.h +++ b/modules/core/include/opencv2/core/cvdef.h @@ -349,7 +349,13 @@ Cv64suf; // We need to use simplified definition for them. #ifndef CV_STATIC_ANALYSIS # if defined(__KLOCWORK__) || defined(__clang_analyzer__) || defined(__COVERITY__) -# define CV_STATIC_ANALYSIS +# define CV_STATIC_ANALYSIS 1 +# endif +#else +# if defined(CV_STATIC_ANALYSIS) && !(__CV_CAT(1, CV_STATIC_ANALYSIS) == 1) // defined and not empty +# if 0 == CV_STATIC_ANALYSIS +# undef CV_STATIC_ANALYSIS +# endif # endif #endif