summaryrefslogtreecommitdiff
path: root/test/geometry.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2023-07-07 12:02:49 +0300
committerKieran Bingham <kieran.bingham@ideasonboard.com>2023-07-11 15:58:06 +0100
commit03526e58d1fc58012374ad83b43c93a9d3ea289f (patch)
tree355a8271d227b575f9a6c58353d24dfe66f3360b /test/geometry.cpp
parent5ca0c9276f284c91bd4779725a150ed2828c9e60 (diff)
tests: gstreamer: Fix compiler error with gcc 8.4.0
The provider g_autoptr variable introduced by commit adb1bbb748a1 ("tests: gstreamer: Test cameras' enumeration from GstDeviceProvider") is left uninitialized when declared. The cleanup function could thus get called on an unitialized variable if the scope was exited before the variable gets initialized. This can't occur here, but gcc 8.4.0 still complains about it: /usr/include/glib-2.0/glib/gmacros.h: In member function ‘virtual int GstreamerDeviceProviderTest::run()’: /usr/include/glib-2.0/glib/gmacros.h:1049:27: error: ‘provider’ may be used uninitialized in this function [-Werror=maybe-uninitialized] { if (_ptr) (cleanup) ((ParentName *) _ptr); } \ ^ ../test/gstreamer/gstreamer_device_provider_test.cpp:37:32: note: ‘provider’ was declared here g_autoptr(GstDeviceProvider) provider; Silence the error by initializing the variable to NULL at declaration time. This is a good practice in any case, as later refactoring could otherwise introduce a scope exit before initialization. Fixes: adb1bbb748a1 ("tests: gstreamer: Test cameras' enumeration from GstDeviceProvider") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'test/geometry.cpp')
0 files changed, 0 insertions, 0 deletions