diff --git a/0001-cam-fix-compilation-with-gcc-13.patch b/0001-cam-fix-compilation-with-gcc-13.patch new file mode 100644 index 0000000..d2172c0 --- /dev/null +++ b/0001-cam-fix-compilation-with-gcc-13.patch @@ -0,0 +1,46 @@ +From e268bf274d315b90d205e3778cf06c40b6f374b6 Mon Sep 17 00:00:00 2001 +From: Wim Taymans +Date: Tue, 24 Jan 2023 16:29:19 +0100 +Subject: [PATCH] cam: fix compilation with gcc-13 + +Fixes following errors with gcc-13: + +../git/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]; + | ^~~~ +../git/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::operator[](i)' + 92 | const FrameMetadata::Plane &meta = buffer->metadata().planes()[i]; + | ^ +cc1plus: all warnings being treated as errors + +Signed-off-by: Khem Raj +Signed-off-by: Wim Taymans +--- + src/apps/cam/file_sink.cpp | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/apps/cam/file_sink.cpp b/src/apps/cam/file_sink.cpp +index b32aad24..9f4c5648 100644 +--- a/src/apps/cam/file_sink.cpp ++++ b/src/apps/cam/file_sink.cpp +@@ -114,13 +114,13 @@ void FileSink::writeBuffer(const Stream *stream, FrameBuffer *buffer, + } + + for (unsigned int i = 0; i < buffer->planes().size(); ++i) { +- const FrameMetadata::Plane &meta = buffer->metadata().planes()[i]; ++ unsigned int bytesused = buffer->metadata().planes()[i].bytesused; + + Span data = image->data(i); +- unsigned int length = std::min(meta.bytesused, data.size()); ++ unsigned int length = std::min(bytesused, data.size()); + +- if (meta.bytesused > data.size()) +- std::cerr << "payload size " << meta.bytesused ++ if (bytesused > data.size()) ++ std::cerr << "payload size " << bytesused + << " larger than plane size " << data.size() + << std::endl; + +-- +2.39.1 + diff --git a/libcamera.spec b/libcamera.spec index 4e815ed..70d2b60 100644 --- a/libcamera.spec +++ b/libcamera.spec @@ -16,6 +16,8 @@ Source0: %{name}-%{version}.tar.xz Source1: qcam.desktop Source2: qcam.metainfo.xml +Patch0001: 0001-cam-fix-compilation-with-gcc-13.patch + BuildRequires: doxygen BuildRequires: gcc-c++ BuildRequires: gtest-devel @@ -165,6 +167,7 @@ rm -rf ${RPM_BUILD_ROOT}/%{_docdir}/%{name}-*/html/.doctrees %changelog * Tue Jan 24 2023 Wim Taymans - 0.0.3-3 - Rebuild for gtest .so bump rhbz#2161870 +- Add patch for gcc13 * Thu Jan 19 2023 Fedora Release Engineering - 0.0.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild