-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
imgcodecs: compile warning at test-avif.cpp #24792
Copy link
Copy link
Closed
Labels
Description
System Information
OpenCV version: 4.x ( 4.9.0 )
Operating System / Platform: Ubuntu 23.10 (x86-64)
Compiler & compiler version: gcc version 13.2.0 (Ubuntu 13.2.0-4ubuntu3)
Detailed description
When AVIF codec is enabled, a compile warning occurs at test_avif.cpp.
Source code:
opencv/modules/imgcodecs/test/test_avif.cpp
Lines 169 to 172 in dad8af6
| bool result; | |
| EXPECT_NO_THROW( | |
| result = cv::imencode(".avif", img_original, buf, encoding_params_);); | |
| EXPECT_TRUE(result); |
Warning message:
[1/2] Building CXX object modules/imgcodecs/CMakeFiles/opencv_test_imgcodecs.dir/test/test_avif.cpp.o
In file included from /home/kmtr/work/opencv/modules/ts/include/opencv2/ts.hpp:128,
from /home/kmtr/work/opencv/modules/imgcodecs/test/test_precomp.hpp:7,
from /home/kmtr/work/opencv/modules/imgcodecs/test/test_avif.cpp:8:
/home/kmtr/work/opencv/modules/imgcodecs/test/test_avif.cpp: In member function ‘virtual void opencv_test::{anonymous}::Imgcodecs_Avif_Image_EncodeDecodeSuite_imencode_imdecode_Test::Body()’:
/home/kmtr/work/opencv/modules/ts/include/opencv2/ts/ts_gtest.h:9274:3: warning: ‘result’ may be used uninitialized [-Wmaybe-uninitialized]
9274 | if (const ::testing::AssertionResult gtest_ar_ = \
| ^~
/home/kmtr/work/opencv/modules/ts/include/opencv2/ts/ts_gtest.h:21796:3: note: in expansion of macro ‘GTEST_TEST_BOOLEAN_’
21796 | GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
| ^~~~~~~~~~~~~~~~~~~
/home/kmtr/work/opencv/modules/imgcodecs/test/test_avif.cpp:172:3: note: in expansion of macro ‘EXPECT_TRUE’
172 | EXPECT_TRUE(result);
| ^~~~~~~~~~~
/home/kmtr/work/opencv/modules/imgcodecs/test/test_avif.cpp:169:8: note: ‘result’ was declared here
169 | bool result;
| ^~~~~~
[2/2] Linking CXX executable bin/opencv_test_imgcodecsSteps to reproduce
apt install libavif-devcmake -S opencv -B build4-main -DWITH_AVIF=oncmake --build
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- I updated to the latest OpenCV version and the issue is still there
- There is reproducer code and related data files (videos, images, onnx, etc)
Reactions are currently unavailable