Merge pull request #22512 from alalek:build_warning_gcc12_uninitialized

build: eliminate uninitialized warnings from GCC12
This commit is contained in:
Alexander Smorkalov 2022-09-20 09:29:00 +03:00 committed by GitHub
commit f2ccce23f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -50,6 +50,12 @@
#include <stdlib.h>
#include "opencv2/core/cvdef.h"
#if defined(__GNUC__) && __GNUC__ == 12
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wuninitialized"
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#define OPENCV_HAL_ADD(a, b) ((a) + (b))
#define OPENCV_HAL_AND(a, b) ((a) & (b))
#define OPENCV_HAL_NOP(a) (a)
@ -695,4 +701,8 @@ CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END
//! @endcond
#if defined(__GNUC__) && __GNUC__ == 12
#pragma GCC diagnostic pop
#endif
#endif

View File

@ -6,6 +6,12 @@
#include "opencv2/core/hal/intrin.hpp"
#if defined(__GNUC__) && __GNUC__ == 12
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wuninitialized"
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
namespace cv { namespace hal {
CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN
@ -465,3 +471,7 @@ void calculate_integral_avx512(const uchar *src, size_t _srcstep,
CV_CPU_OPTIMIZATION_NAMESPACE_END
}} // end namespace cv::hal
#if defined(__GNUC__) && __GNUC__ == 12
#pragma GCC diagnostic pop
#endif