[{"id":38419,"web_url":"https://patchwork.libcamera.org/comment/38419/","msgid":"<20260326151533.GB2919822@killaraus.ideasonboard.com>","date":"2026-03-26T15:15:33","subject":"Re: [RFC PATCH v2 7/7] libcamera: base: span: Deprecate it","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Mon, Mar 23, 2026 at 11:27:24AM +0100, Barnabás Pőcze wrote:\n> With the switch to C++20, this type has largely become unnecessary,\n> but since users might still depend on it, do not remove it yet, only\n> deprecate it. The tests are also kept for now.\n\nThis seems reasonable. We could drop the tests already as the Span class\nshouldn't be touched any more, but it doesn't hurt keeping them until we\ndrop span.h.\n\nDo you have a timeline in mind for removing the header completely ?\n\n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  include/libcamera/base/span.h | 4 ++--\n>  test/span.cpp                 | 1 +\n>  2 files changed, 3 insertions(+), 2 deletions(-)\n> \n> diff --git a/include/libcamera/base/span.h b/include/libcamera/base/span.h\n> index 5c7a98d8e..c8da7cfd1 100644\n> --- a/include/libcamera/base/span.h\n> +++ b/include/libcamera/base/span.h\n> @@ -86,7 +86,7 @@ struct tuple_size<Span<T, dynamic_extent>>;\n>  } /* namespace utils */\n>  \n>  template<typename T, std::size_t Extent>\n> -class Span\n> +class [[deprecated(\"Use `std::span` instead\")]] Span\n>  {\n>  public:\n>  \tusing element_type = T;\n> @@ -256,7 +256,7 @@ private:\n>  };\n>  \n>  template<typename T>\n> -class Span<T, dynamic_extent>\n> +class [[deprecated(\"Use `std::span` instead\")]] Span<T, dynamic_extent>\n>  {\n>  public:\n>  \tusing element_type = T;\n> diff --git a/test/span.cpp b/test/span.cpp\n> index 4b9f3279a..56b29512f 100644\n> --- a/test/span.cpp\n> +++ b/test/span.cpp\n> @@ -9,6 +9,7 @@\n>   * Include first to ensure the header is self-contained, as there's no span.cpp\n>   * in libcamera.\n>   */\n> +#pragma GCC diagnostic ignored \"-Wdeprecated-declarations\"\n>  #include <libcamera/base/span.h>\n>  \n>  #include <array>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id B6D5CBDCBD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 26 Mar 2026 15:15:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 92F3262850;\n\tThu, 26 Mar 2026 16:15:35 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B6E5A62781\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 Mar 2026 16:15:34 +0100 (CET)","from killaraus.ideasonboard.com\n\t(2001-14ba-703d-e500--2a1.rev.dnainternet.fi\n\t[IPv6:2001:14ba:703d:e500::2a1])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id A975F594;\n\tThu, 26 Mar 2026 16:14:15 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"DTZZ9jDD\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1774538055;\n\tbh=bmGzSyyBLSieSwq3yAXM7OCFNxPTwD1d/+I5ia00yHo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=DTZZ9jDDQxX+VLfRcet80wOAoXrx3OtW+yjvl2VemCbko5onobz/P+j3nfkN+dH4e\n\t1unq3gFO5GgLkaJAAyrwYQ2yTWcVEXL/DcEdxnGWklAd8nztnJ+VClt6qX1gmbOyag\n\t9F7mJ2jPGkui0Ct2K4MdhsdFIWVpYFKyops1poW0=","Date":"Thu, 26 Mar 2026 17:15:33 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH v2 7/7] libcamera: base: span: Deprecate it","Message-ID":"<20260326151533.GB2919822@killaraus.ideasonboard.com>","References":"<20260323102724.1385487-1-barnabas.pocze@ideasonboard.com>\n\t<20260323102724.1385487-8-barnabas.pocze@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20260323102724.1385487-8-barnabas.pocze@ideasonboard.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":38431,"web_url":"https://patchwork.libcamera.org/comment/38431/","msgid":"<7a301ada-829e-4543-b937-3d0c155c2ee7@ideasonboard.com>","date":"2026-03-27T08:28:44","subject":"Re: [RFC PATCH v2 7/7] libcamera: base: span: Deprecate it","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 03. 26. 16:15 keltezéssel, Laurent Pinchart írta:\n> On Mon, Mar 23, 2026 at 11:27:24AM +0100, Barnabás Pőcze wrote:\n>> With the switch to C++20, this type has largely become unnecessary,\n>> but since users might still depend on it, do not remove it yet, only\n>> deprecate it. The tests are also kept for now.\n> \n> This seems reasonable. We could drop the tests already as the Span class\n> shouldn't be touched any more, but it doesn't hurt keeping them until we\n> drop span.h.\n> \n> Do you have a timeline in mind for removing the header completely ?\n\nNot sure, first gcc 9 support needs to be dropped, then I think having one or two\nreleases with the deprecation is reasonable.\n\n\n> \n>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n>> ---\n>>   include/libcamera/base/span.h | 4 ++--\n>>   test/span.cpp                 | 1 +\n>>   2 files changed, 3 insertions(+), 2 deletions(-)\n>>\n>> diff --git a/include/libcamera/base/span.h b/include/libcamera/base/span.h\n>> index 5c7a98d8e..c8da7cfd1 100644\n>> --- a/include/libcamera/base/span.h\n>> +++ b/include/libcamera/base/span.h\n>> @@ -86,7 +86,7 @@ struct tuple_size<Span<T, dynamic_extent>>;\n>>   } /* namespace utils */\n>>   \n>>   template<typename T, std::size_t Extent>\n>> -class Span\n>> +class [[deprecated(\"Use `std::span` instead\")]] Span\n>>   {\n>>   public:\n>>   \tusing element_type = T;\n>> @@ -256,7 +256,7 @@ private:\n>>   };\n>>   \n>>   template<typename T>\n>> -class Span<T, dynamic_extent>\n>> +class [[deprecated(\"Use `std::span` instead\")]] Span<T, dynamic_extent>\n>>   {\n>>   public:\n>>   \tusing element_type = T;\n>> diff --git a/test/span.cpp b/test/span.cpp\n>> index 4b9f3279a..56b29512f 100644\n>> --- a/test/span.cpp\n>> +++ b/test/span.cpp\n>> @@ -9,6 +9,7 @@\n>>    * Include first to ensure the header is self-contained, as there's no span.cpp\n>>    * in libcamera.\n>>    */\n>> +#pragma GCC diagnostic ignored \"-Wdeprecated-declarations\"\n>>   #include <libcamera/base/span.h>\n>>   \n>>   #include <array>\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id B80BCBDCBD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Mar 2026 08:28:46 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 765DA62BB6;\n\tFri, 27 Mar 2026 09:28:46 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E53176271A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Mar 2026 09:28:44 +0100 (CET)","from [192.168.33.24] (185.221.143.129.nat.pool.zt.hu\n\t[185.221.143.129])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 961507CA;\n\tFri, 27 Mar 2026 09:27:25 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"aVv9UDR6\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1774600045;\n\tbh=FDvjr/S6atogz7GNsGGraMHTYb3Y9KbQ1tBXnloaCH4=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=aVv9UDR66Kl0OTO4eMVQ1Xy2+lv1jbabRt7vhgDUvPosyXO3CO9104uxpQ81zknyB\n\tgmT89Y5M0aZCc9xEWY4ndW7qODisEhpGolqwZUdyA+SLt1XxTAu+gW2gM+YG/vjfa5\n\tq49VkTnPoI5kS2oQQNg5a1C+oVMj4IB21abyCIMg=","Message-ID":"<7a301ada-829e-4543-b937-3d0c155c2ee7@ideasonboard.com>","Date":"Fri, 27 Mar 2026 09:28:44 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [RFC PATCH v2 7/7] libcamera: base: span: Deprecate it","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","References":"<20260323102724.1385487-1-barnabas.pocze@ideasonboard.com>\n\t<20260323102724.1385487-8-barnabas.pocze@ideasonboard.com>\n\t<20260326151533.GB2919822@killaraus.ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260326151533.GB2919822@killaraus.ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":38434,"web_url":"https://patchwork.libcamera.org/comment/38434/","msgid":"<20260327083520.GC2993961@killaraus.ideasonboard.com>","date":"2026-03-27T08:35:20","subject":"Re: [RFC PATCH v2 7/7] libcamera: base: span: Deprecate it","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Fri, Mar 27, 2026 at 09:28:44AM +0100, Barnabás Pőcze wrote:\n> 2026. 03. 26. 16:15 keltezéssel, Laurent Pinchart írta:\n> > On Mon, Mar 23, 2026 at 11:27:24AM +0100, Barnabás Pőcze wrote:\n> >> With the switch to C++20, this type has largely become unnecessary,\n> >> but since users might still depend on it, do not remove it yet, only\n> >> deprecate it. The tests are also kept for now.\n> > \n> > This seems reasonable. We could drop the tests already as the Span class\n> > shouldn't be touched any more, but it doesn't hurt keeping them until we\n> > drop span.h.\n> > \n> > Do you have a timeline in mind for removing the header completely ?\n> \n> Not sure, first gcc 9 support needs to be dropped, then I think having one or two\n> releases with the deprecation is reasonable.\n\nSounds good to me, thanks.\n\n> >> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> > \n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > \n> >> ---\n> >>   include/libcamera/base/span.h | 4 ++--\n> >>   test/span.cpp                 | 1 +\n> >>   2 files changed, 3 insertions(+), 2 deletions(-)\n> >>\n> >> diff --git a/include/libcamera/base/span.h b/include/libcamera/base/span.h\n> >> index 5c7a98d8e..c8da7cfd1 100644\n> >> --- a/include/libcamera/base/span.h\n> >> +++ b/include/libcamera/base/span.h\n> >> @@ -86,7 +86,7 @@ struct tuple_size<Span<T, dynamic_extent>>;\n> >>   } /* namespace utils */\n> >>   \n> >>   template<typename T, std::size_t Extent>\n> >> -class Span\n> >> +class [[deprecated(\"Use `std::span` instead\")]] Span\n> >>   {\n> >>   public:\n> >>   \tusing element_type = T;\n> >> @@ -256,7 +256,7 @@ private:\n> >>   };\n> >>   \n> >>   template<typename T>\n> >> -class Span<T, dynamic_extent>\n> >> +class [[deprecated(\"Use `std::span` instead\")]] Span<T, dynamic_extent>\n> >>   {\n> >>   public:\n> >>   \tusing element_type = T;\n> >> diff --git a/test/span.cpp b/test/span.cpp\n> >> index 4b9f3279a..56b29512f 100644\n> >> --- a/test/span.cpp\n> >> +++ b/test/span.cpp\n> >> @@ -9,6 +9,7 @@\n> >>    * Include first to ensure the header is self-contained, as there's no span.cpp\n> >>    * in libcamera.\n> >>    */\n> >> +#pragma GCC diagnostic ignored \"-Wdeprecated-declarations\"\n> >>   #include <libcamera/base/span.h>\n> >>   \n> >>   #include <array>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 3D6B3BE086\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Mar 2026 08:35:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0582B62C43;\n\tFri, 27 Mar 2026 09:35:23 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4836A62862\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Mar 2026 09:35:22 +0100 (CET)","from killaraus.ideasonboard.com\n\t(2001-14ba-703d-e500--2a1.rev.dnainternet.fi\n\t[IPv6:2001:14ba:703d:e500::2a1])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id D38321783; \n\tFri, 27 Mar 2026 09:34:02 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ua70f3HF\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1774600443;\n\tbh=sFP2GzEwTAvK4b6pxRqIABR0Fr7jAkRpKzDi/EJynlE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ua70f3HFV5XLh1zEjTdUNxNSUMpjX4ochGyMHBoWWJPiU7HvdUnm+DtD+mLMhNC2X\n\tJIJlOtwZycMSd6C3Owdqr2lstSw2gQMKvVa6is0QZ+iH4PbjGGqe5LMYh2ccFLf1oU\n\tmpV4gVvmxwDHUvihDk8UCVI8K7j1Oa8j+iqN/ecw=","Date":"Fri, 27 Mar 2026 10:35:20 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH v2 7/7] libcamera: base: span: Deprecate it","Message-ID":"<20260327083520.GC2993961@killaraus.ideasonboard.com>","References":"<20260323102724.1385487-1-barnabas.pocze@ideasonboard.com>\n\t<20260323102724.1385487-8-barnabas.pocze@ideasonboard.com>\n\t<20260326151533.GB2919822@killaraus.ideasonboard.com>\n\t<7a301ada-829e-4543-b937-3d0c155c2ee7@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<7a301ada-829e-4543-b937-3d0c155c2ee7@ideasonboard.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]