From 42ba5c7d16d21fcf4ecc575a483f99d782f847fc Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Wed, 22 Jul 2015 14:17:37 +0300 Subject: [PATCH] fix GCC 4.9 warnings --- cmake/OpenCVCompilerOptions.cmake | 2 ++ modules/imgproc/test/test_distancetransform.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake index a69ac8c7e..7b619818d 100644 --- a/cmake/OpenCVCompilerOptions.cmake +++ b/cmake/OpenCVCompilerOptions.cmake @@ -95,6 +95,8 @@ if(CMAKE_COMPILER_IS_GNUCXX) add_extra_compiler_option(-Wno-narrowing) add_extra_compiler_option(-Wno-delete-non-virtual-dtor) add_extra_compiler_option(-Wno-unnamed-type-template-args) + add_extra_compiler_option(-Wno-array-bounds) + add_extra_compiler_option(-Wno-aggressive-loop-optimizations) endif() add_extra_compiler_option(-fdiagnostics-show-option) diff --git a/modules/imgproc/test/test_distancetransform.cpp b/modules/imgproc/test/test_distancetransform.cpp index bbbb3479e..e61e5a986 100644 --- a/modules/imgproc/test/test_distancetransform.cpp +++ b/modules/imgproc/test/test_distancetransform.cpp @@ -166,10 +166,10 @@ cvTsDistTransform( const CvMat* _src, CvMat* _dst, int dist_type, int i, j, k; int width = _src->cols, height = _src->rows; const float init_val = 1e6; - float mask[3]; + float mask[3] = { 0 }; CvMat* temp; - int ofs[16]; - float delta[16]; + int ofs[16] = { 0 }; + float delta[16] = { 0 }; int tstep, count; assert( mask_size == 3 || mask_size == 5 );