1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Merge pull request #27337 from fengyuentau:4x/build/riscv/fix_warnings

build: fix warnings from recent gcc versions #27337

This PR addresses the following found warnings:
- [x] -Wmaybe-uninitialized
- [x] -Wunused-variable
- [x] -Wsign-compare

Tested building with GCC 14.2 (RISC-V 64).

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
Yuantao Feng
2025-05-21 14:28:29 +08:00
committed by GitHub
parent c3fe92d813
commit 166f76d224
8 changed files with 49 additions and 43 deletions
+15
View File
@@ -24,6 +24,17 @@ void test_hal_intrin_float16();
//==================================================================================================
#if defined (__GNUC__) && defined(__has_warning)
#if __has_warning("-Wmaybe-uninitialized")
#define CV_DISABLE_GCC_MAYBE_UNINITIALIZED_WARNINGS
#endif
#endif
#if defined (CV_DISABLE_GCC_MAYBE_UNINITIALIZED_WARNINGS)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
template <typename R> struct Data
{
typedef typename VTraits<R>::lane_type LaneType;
@@ -2409,6 +2420,10 @@ void test_hal_intrin_float16()
}
#endif*/
#if defined (CV_DISABLE_GCC_MAYBE_UNINITIALIZED_WARNINGS)
#pragma GCC diagnostic pop
#endif
#endif //CV_CPU_OPTIMIZATION_DECLARATIONS_ONLY
//CV_CPU_OPTIMIZATION_NAMESPACE_END