diff options
author | Barnabás Pőcze <pobrn@protonmail.com> | 2024-05-27 13:24:29 +0000 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2024-05-27 23:53:59 +0300 |
commit | c79fa47aac9b38865dab5e9f29030903bf460c46 (patch) | |
tree | fb6c1cbdb4da74ca9e29c9bd642744f2a7ea161e /src/android/jpeg/thumbnailer.cpp | |
parent | 807119d1e0d27ffe50b10ccfc6ee7bf64ea03e74 (diff) |
android: camera_capabilities: Fix GCC 14 warning
GCC 14 thinks `rects` is a "possibly dangling reference to a temporary":
/libcamera/src/android/camera_capabilities.cpp: In member function ‘int CameraCapabilities::initializeStaticMetadata()’:
/libcamera/src/android/camera_capabilities.cpp:1084:46: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
1084 | const Span<const Rectangle>& rects =
| ^~~~~
/libcamera/src/android/camera_capabilities.cpp:1085:83: note: the temporary was destroyed at the end of the full expression ‘(& properties)->libcamera::ControlList::get<libcamera::Span<const libcamera::Rectangle> >(libcamera::properties::PixelArrayActiveAreas).std::optional<libcamera::Span<const libcamera::Rectangle> >::value_or<libcamera::Span<const libcamera::Rectangle> >(libcamera::Span<const libcamera::Rectangle>())’
1085 | properties.get(properties::PixelArrayActiveAreas).value_or(Span<const Rectangle>{});
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
The return value of `value_or()` is indeed a temporary, but binding it
to a reference extends its lifetime. Avoid the warning by not using a
reference; this does not make much difference since `value_or()` does
not return a reference.
Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/android/jpeg/thumbnailer.cpp')
0 files changed, 0 insertions, 0 deletions