diff options
author | Eric Curtin <ecurtin@redhat.com> | 2023-02-20 04:55:24 +0000 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2023-05-01 11:39:07 +0100 |
commit | 13759e1006b0133d20e9f6b1ce44ce9751f3d41d (patch) | |
tree | 2b52d4e97a66f397d92eb39489503e68d330ea6d /src/apps/qcam/assets/feathericons/toggle-right.svg | |
parent | af7d6a4c2df6c836ecc704ea44b39ea07418d832 (diff) |
cam: file_sink: Workaround gcc-13 dangling-reference false positive
A new warning has been introduced to gcc-13 that produces a false
positive on the cam file sink object:
src/cam/file_sink.cpp:92:45: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
92 | const FrameMetadata::Plane &meta = buffer->metadata().planes()[i];
| ^~~~
src/cam/file_sink.cpp:92:81: note: the temporary was destroyed at the end of the full expression '(& buffer->libcamera::FrameBuffer::metadata())->libcamera::FrameMetadata::planes().libcamera::Span<const libcamera::FrameMetadata::Plane>::operator[](i)'
92 | const FrameMetadata::Plane &meta = buffer->metadata().planes()[i];
| ^
cc1plus: all warnings being treated as errors
Workaround this issue by refactoring the code to take a local const
copy of the bytesused value, rather than a local const reference to the
plane.
Bug: https://bugs.libcamera.org/show_bug.cgi?id=185
Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107532
Co-developed-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Eric Curtin <ecurtin@redhat.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
[Kieran: Commit and comment reworded prior to merge]
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/apps/qcam/assets/feathericons/toggle-right.svg')
0 files changed, 0 insertions, 0 deletions