From 7eb106594406e599c0b2ba372adbfb1b95ca957b Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Wed, 29 Nov 2017 16:51:50 +0300 Subject: [PATCH] Fixed/disabled warnings produced by GCC 7 --- cmake/OpenCVCompilerOptions.cmake | 3 +++ modules/imgcodecs/src/grfmt_gdal.cpp | 3 ++- modules/videoio/src/cap_openni2.cpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake index d177b25..f45ebdd 100644 --- a/cmake/OpenCVCompilerOptions.cmake +++ b/cmake/OpenCVCompilerOptions.cmake @@ -128,6 +128,9 @@ if(CMAKE_COMPILER_IS_GNUCXX) add_extra_compiler_option(-Wno-unnamed-type-template-args) add_extra_compiler_option(-Wno-comment) add_extra_compiler_option(-Wno-implicit-fallthrough) + if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 7.2.0) + add_extra_compiler_option(-Wno-strict-overflow) # Issue is fixed in GCC 7.2.1 + endif() endif() add_extra_compiler_option(-fdiagnostics-show-option) diff --git a/modules/imgcodecs/src/grfmt_gdal.cpp b/modules/imgcodecs/src/grfmt_gdal.cpp index c04e287..ade8e89 100644 --- a/modules/imgcodecs/src/grfmt_gdal.cpp +++ b/modules/imgcodecs/src/grfmt_gdal.cpp @@ -426,7 +426,8 @@ bool GdalDecoder::readData( Mat& img ){ for( int y=0; yRasterIO( GF_Read, 0, y, nCols, 1, scanline, nCols, 1, GDT_Float64, 0, 0); + CPLErr err = band->RasterIO( GF_Read, 0, y, nCols, 1, scanline, nCols, 1, GDT_Float64, 0, 0); + CV_Assert(err == CE_None); // set inside the image for( int x=0; x