build: fix build with defined CV_STATIC_ANALYSIS

pull/12272/head
Alexander Alekhin 7 years ago
parent 18833d5121
commit 2c42361ecd
  1. 7
      modules/core/include/opencv2/core/base.hpp
  2. 8
      modules/core/include/opencv2/core/cvdef.h

@ -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

@ -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

Loading…
Cancel
Save