From patchwork Mon Mar 23 10:27:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 26314 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 76388C32DE for ; Mon, 23 Mar 2026 10:27:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1DF936275D; Mon, 23 Mar 2026 11:27:30 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="o/PwRFGG"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9562162745 for ; Mon, 23 Mar 2026 11:27:27 +0100 (CET) Received: from pb-laptop.local (185.221.143.129.nat.pool.zt.hu [185.221.143.129]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1F46A189C; Mon, 23 Mar 2026 11:26:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1774261571; bh=1Zbs79fFLhxiKcFW+fadyrtBr7zoonqptL9IgKheJ4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o/PwRFGGHZzs2AyH8eLVaqeBfwTbo82MXcS4HLnuI8bYoP9+A1EXEPEMTIyjsTHkQ p4ZZRBtfpisMPJ1G36NeVWUj4Wb5rqArSZT7pSHN2HC/nEGg9ft+zOt3k7qqtpt/I5 4Luezvv012cT5ZGj3xAuIeFNbQpXwGVHYCk1Jr4U= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Laurent Pinchart , Naushir Patuck Subject: [RFC PATCH v2 1/7] gstreamer: Add `-Wno-volatile` for GCC Date: Mon, 23 Mar 2026 11:27:18 +0100 Message-ID: <20260323102724.1385487-2-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323102724.1385487-1-barnabas.pocze@ideasonboard.com> References: <20260323102724.1385487-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Older versions of glib may use `volatile` qualified variables, triggering the warning in C++20. So suppress it. Link: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719 Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Reviewed-by: Naushir Patuck --- src/gstreamer/meson.build | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build index fd83e073d..602f978e8 100644 --- a/src/gstreamer/meson.build +++ b/src/gstreamer/meson.build @@ -50,6 +50,13 @@ if cc.get_id() == 'clang' and glib_dep.version().version_compare('<2.63.0') libcamera_gst_cpp_args += ['-Wno-unused-function'] endif +# In C++20 many operations involving the `volatile` qualifier became deprecated. +# glib however made use of `volatile` in certain macros that would trigger +# this warning. See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719. +if cc.get_id() == 'gcc' and glib_dep.version().version_compare('<2.67.1') + libcamera_gst_cpp_args += ['-Wno-volatile'] +endif + libcamera_gst = shared_library('gstlibcamera', libcamera_gst_sources, cpp_args : libcamera_gst_cpp_args, From patchwork Mon Mar 23 10:27:19 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 26315 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 32FC0C32F5 for ; Mon, 23 Mar 2026 10:27:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9C70862764; Mon, 23 Mar 2026 11:27:30 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="I/krynXv"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C26D562737 for ; Mon, 23 Mar 2026 11:27:27 +0100 (CET) Received: from pb-laptop.local (185.221.143.129.nat.pool.zt.hu [185.221.143.129]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5BF37591; Mon, 23 Mar 2026 11:26:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1774261571; bh=87Zl8dAVhoX7TEAN+gzR8eiODF1j0cJrZ90GT79RjCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I/krynXvefRNBnQavvkr6G0UNOsIrpzFPek5IpIt33I3rCFOvY0k5uTz/IGye1a68 uO53zy9lYf6ow4o8Ix+lR5+Cn5I4yEnNjDLvdY4cu2O/SfR7YsxGn48N0qy59Xb7pq nGW+cMxz1dU+GFuoPB+/zOEiJskh4Ek+pr2tQai8= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Laurent Pinchart Subject: [RFC PATCH v2 2/7] meson: Ignore `Wredundant-move` with GCC 11 and above Date: Mon, 23 Mar 2026 11:27:19 +0100 Message-ID: <20260323102724.1385487-3-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323102724.1385487-1-barnabas.pocze@ideasonboard.com> References: <20260323102724.1385487-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" In C++20 mode, object slicing in a return statement triggers automatic move since GCC 11, and using `std::move()` emits `-Wredundant-move` in those same GCC versions. So disable the warning in those as well. This is relevant for `valueOrTuple()` in `py_helpers.cpp`, which returns a `py::tuple` as `py::object`. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- meson.build | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index 82867f82b..fa38fa2c0 100644 --- a/meson.build +++ b/meson.build @@ -159,16 +159,17 @@ if cc.get_id() == 'gcc' error('gcc version is too old, libcamera requires 9.0 or newer') endif - # gcc 13 implements the C++23 version of automatic move from local - # variables in return statements (see - # https://en.cppreference.com/w/cpp/language/return). As a result, some - # previously required explicit std::move() in return statements generate - # warnings. Those moves can't be removed as older compiler versions could - # use copy constructors instead of move constructors. The easiest fix is to - # disable the warning. With -Wpessimizing-move enabled, the compiler will - # still warn of pessimizing moves, only the redundant but not pessimizing - # moves will be ignored. - if cc.version().version_compare('>=13') + # In C++20 mode, prior to gcc 11, object slicing in a return statement didn't + # perform automatic move. It required explicit std::move() usage, which now + # generate warnings. Those moves can't be removed as older compiler versions + # could use copy constructors instead of move constructors. The easiest fix + # is to disable the warning. With -Wpessimizing-move enabled, the compiler + # will still warn of pessimizing moves, only the redundant but not + # pessimizing moves will be ignored. + # + # \todo When dropping support for compilers older than gcc 11, drop the + # argument and remove the unneeded std::move() calls. + if cc.version().version_compare('>=11') cpp_arguments += [ '-Wno-redundant-move', ] From patchwork Mon Mar 23 10:27:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 26316 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id E2EFAC32F8 for ; Mon, 23 Mar 2026 10:27:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8E52962772; Mon, 23 Mar 2026 11:27:33 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="HbSyb23+"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 676EC62745 for ; Mon, 23 Mar 2026 11:27:28 +0100 (CET) Received: from pb-laptop.local (185.221.143.129.nat.pool.zt.hu [185.221.143.129]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0DD332441; Mon, 23 Mar 2026 11:26:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1774261572; bh=pt4sxJQSioBnApzvjCPsPrLs0ukY6fhQPJpRuo4J5Dw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HbSyb23+MuESNPSLKYgm3s398cLQy/q9FN52Uahqx/46Vz7s4EzRnRtIlmL36aFbF cvBZBFF+Bcy6/4+12ot7LvcbMc7IWp5IZZBtPGmh2yejt4LcdPQeqjLyVhkxBfJL7F lT+KWVj422hSMlgm3xYVyePMq3ynJX+PqWQwxw6Q= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [RFC PATCH v2 5/7] meson: Switch to C++20 Date: Mon, 23 Mar 2026 11:27:22 +0100 Message-ID: <20260323102724.1385487-6-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323102724.1385487-1-barnabas.pocze@ideasonboard.com> References: <20260323102724.1385487-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Switch to using the C++20 standard when compiling libcamera. Signed-off-by: Barnabás Pőcze Reviewed-by: Naushir Patuck Acked-by: Kieran Bingham --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index fa38fa2c0..2e2a27ef4 100644 --- a/meson.build +++ b/meson.build @@ -6,7 +6,7 @@ project('libcamera', 'c', 'cpp', default_options : [ 'werror=true', 'warning_level=2', - 'cpp_std=c++17', + 'cpp_std=c++20', ], license : 'LGPL 2.1+') From patchwork Mon Mar 23 10:27:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 26317 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 6478AC32FA for ; Mon, 23 Mar 2026 10:27:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4BAB462771; Mon, 23 Mar 2026 11:27:35 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="OQjVS17+"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3389762771 for ; Mon, 23 Mar 2026 11:27:29 +0100 (CET) Received: from pb-laptop.local (185.221.143.129.nat.pool.zt.hu [185.221.143.129]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D36A7591 for ; Mon, 23 Mar 2026 11:26:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1774261572; bh=PQ6GVCpIIkh4F1O2Lch5iO4mgvIHjVwf5jkItDhKTko=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OQjVS17+ke2ZDauUh4VFS4deqVi9JmgnZ7DD7I/Tjur2Oi+j7ZqxGzsKtH73aD2qG y6veDCy07HWXWVyjKC6wYX/YRHprV9yKdrHFCqX/y4RkWpxwPcjEdBdhMc3vYbaH8E zNAU7i+0+Pd948DjnzaoIBS7H7PimNjiBEVIvYHA= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v2 7/7] libcamera: base: span: Deprecate it Date: Mon, 23 Mar 2026 11:27:24 +0100 Message-ID: <20260323102724.1385487-8-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323102724.1385487-1-barnabas.pocze@ideasonboard.com> References: <20260323102724.1385487-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" With the switch to C++20, this type has largely become unnecessary, but since users might still depend on it, do not remove it yet, only deprecate it. The tests are also kept for now. Signed-off-by: Barnabás Pőcze --- include/libcamera/base/span.h | 4 ++-- test/span.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/libcamera/base/span.h b/include/libcamera/base/span.h index 5c7a98d8e..c8da7cfd1 100644 --- a/include/libcamera/base/span.h +++ b/include/libcamera/base/span.h @@ -86,7 +86,7 @@ struct tuple_size>; } /* namespace utils */ template -class Span +class [[deprecated("Use `std::span` instead")]] Span { public: using element_type = T; @@ -256,7 +256,7 @@ private: }; template -class Span +class [[deprecated("Use `std::span` instead")]] Span { public: using element_type = T; diff --git a/test/span.cpp b/test/span.cpp index 4b9f3279a..56b29512f 100644 --- a/test/span.cpp +++ b/test/span.cpp @@ -9,6 +9,7 @@ * Include first to ensure the header is self-contained, as there's no span.cpp * in libcamera. */ +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #include #include