Warning supression fix for XCode 13.1 and newer. Backport #23203

pull/23214/head
Alexander Smorkalov 2 years ago
parent cb2052dbfe
commit 3d635cb4a7
  1. 5
      3rdparty/libpng/CMakeLists.txt
  2. 9
      modules/calib3d/test/test_cameracalibration.cpp
  3. 2
      modules/flann/include/opencv2/flann/index_testing.h
  4. 3
      modules/ml/src/kdtree.cpp
  5. 3
      modules/ts/include/opencv2/ts.hpp
  6. 3
      modules/video/test/test_optflowpyrlk.cpp

@ -66,6 +66,11 @@ if(PPC64LE OR PPC64)
endif()
endif()
if(APPLE AND CV_CLANG AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.1)
ocv_warnings_disable(CMAKE_C_FLAGS -Wnull-pointer-subtraction)
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-but-set-variable)
endif()
# ----------------------------------------------------------------------------------
# Define the library target:
# ----------------------------------------------------------------------------------

@ -559,12 +559,9 @@ void CV_CameraCalibrationTest::run( int start_from )
i = 0;
double dx,dy;
double rx,ry;
double meanDx,meanDy;
double maxDx = 0.0;
double maxDy = 0.0;
meanDx = 0;
meanDy = 0;
for( currImage = 0; currImage < numImages; currImage++ )
{
double imageMeanDx = 0;
@ -576,9 +573,6 @@ void CV_CameraCalibrationTest::run( int start_from )
dx = rx - imagePoints[i].x;
dy = ry - imagePoints[i].y;
meanDx += dx;
meanDy += dy;
imageMeanDx += dx*dx;
imageMeanDy += dy*dy;
@ -601,9 +595,6 @@ void CV_CameraCalibrationTest::run( int start_from )
perViewErrors[currImage] = goodPerViewErrors[currImage];
}
meanDx /= numImages * etalonSize.width * etalonSize.height;
meanDy /= numImages * etalonSize.width * etalonSize.height;
/* ========= Compare parameters ========= */
/* ----- Compare focal lengths ----- */

@ -246,7 +246,6 @@ void test_index_precisions(NNIndex<Distance>& index, const Matrix<typename Dista
float p2;
int c1 = 1;
float p1;
float time;
DistanceType dist;
@ -270,7 +269,6 @@ void test_index_precisions(NNIndex<Distance>& index, const Matrix<typename Dista
precision = precisions[i];
while (p2<precision) {
c1 = c2;
p1 = p2;
c2 *=2;
p2 = search_with_ground_truth(index, inputData, testData, matches, nn, c2, time, dist, distance, skipMatches);
if ((maxTime> 0)&&(time > maxTime)&&(p2<precision)) return;

@ -120,16 +120,13 @@ medianPartition( size_t* ofs, int a, int b, const float* vals )
}
float pivot = vals[ofs[middle]];
int less = 0, more = 0;
for( k = a0; k < middle; k++ )
{
CV_Assert(vals[ofs[k]] <= pivot);
less += vals[ofs[k]] < pivot;
}
for( k = b0; k > middle; k-- )
{
CV_Assert(vals[ofs[k]] >= pivot);
more += vals[ofs[k]] > pivot;
}
return vals[ofs[middle]];

@ -122,6 +122,9 @@
//#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsuggest-override"
#endif
#if defined(__OPENCV_BUILD) && defined(__APPLE__) && defined(__clang__) && ((__clang_major__*100 + __clang_minor__) >= 1301)
#pragma clang diagnostic ignored "-Wdeprecated-copy"
#endif
#include "opencv2/ts/ts_gtest.h"
#if defined(__OPENCV_BUILD) && defined(__GNUC__) && __GNUC__ >= 5
//#pragma GCC diagnostic pop

@ -65,7 +65,7 @@ void CV_OptFlowPyrLKTest::run( int )
const int bad_points_max = 8;
/* test parameters */
double max_err = 0., sum_err = 0;
double max_err = 0.;
int pt_cmpd = 0;
int pt_exceed = 0;
int merr_i = 0, merr_j = 0, merr_k = 0, merr_nan = 0;
@ -175,7 +175,6 @@ void CV_OptFlowPyrLKTest::run( int )
}
pt_exceed += err > success_error_level;
sum_err += err;
pt_cmpd++;
}
else

Loading…
Cancel
Save