utils: abi-compat: Configure for C++20 to support std::span
diff mbox series

Message ID 20261130193309.2716818-1-kieran.bingham@ideasonboard.com
State New
Headers show
Series
  • utils: abi-compat: Configure for C++20 to support std::span
Related show

Commit Message

Kieran Bingham Nov. 30, 2026, 7:32 p.m. UTC
Now that we use std::span, pass -std=c++20 to the compliance checker
invocations of GCC to allow those.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---

Without this, the abi-compliance compile process gets quite upset with a
range of errors and warnings including:

base/span.h:17:54: note: ‘std::span’ is only available from C++20 onwards
   17 | using Span [[deprecated("use std::span instead")]] = std::span<T, Extent>;
      |                                                      ^~~

Easily fixed by letting it use C++20.

 utils/abi-compat.sh | 1 +
 1 file changed, 1 insertion(+)

Comments

Laurent Pinchart Dec. 1, 2026, 1:49 a.m. UTC | #1
On Mon, Nov 30, 2026 at 07:32:57PM +0000, Kieran Bingham wrote:
> Now that we use std::span, pass -std=c++20 to the compliance checker
> invocations of GCC to allow those.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> ---
> 
> Without this, the abi-compliance compile process gets quite upset with a
> range of errors and warnings including:
> 
> base/span.h:17:54: note: ‘std::span’ is only available from C++20 onwards
>    17 | using Span [[deprecated("use std::span instead")]] = std::span<T, Extent>;
>       |                                                      ^~~
> 
> Easily fixed by letting it use C++20.
> 
>  utils/abi-compat.sh | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/utils/abi-compat.sh b/utils/abi-compat.sh
> index 31f61e320404..d6014634cd51 100755
> --- a/utils/abi-compat.sh
> +++ b/utils/abi-compat.sh
> @@ -177,6 +177,7 @@ create_abi_dump() {
>  			"$install"
>  
>  		abi-compliance-checker \
> +			-gcc-options "-std=c++20" \

It would be nice if this could be retrieved from meson.build, but I
suppose it's not worth the effort.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

>  			-lib libcamera \
>  			-v1 "$version" \
>  			-dump "$install/libcamera-abi-dump.xml" \

Patch
diff mbox series

diff --git a/utils/abi-compat.sh b/utils/abi-compat.sh
index 31f61e320404..d6014634cd51 100755
--- a/utils/abi-compat.sh
+++ b/utils/abi-compat.sh
@@ -177,6 +177,7 @@  create_abi_dump() {
 			"$install"
 
 		abi-compliance-checker \
+			-gcc-options "-std=c++20" \
 			-lib libcamera \
 			-v1 "$version" \
 			-dump "$install/libcamera-abi-dump.xml" \