[v1] py: Disable `-Winvalid-offsetof`
diff mbox series

Message ID 20260220141216.195395-1-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • [v1] py: Disable `-Winvalid-offsetof`
Related show

Commit Message

Barnabás Pőcze Feb. 20, 2026, 2:12 p.m. UTC
A "small vector" implementation has been introduced in the latest version
of pybind11 (3.0.2), which might `offsetof()` on a non standard layout type.
This triggers the `invalid-offsetof` warning.

So disable it for the python binding.

Link: https://github.com/pybind/pybind11/pull/5824
Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 src/py/libcamera/meson.build | 1 +
 1 file changed, 1 insertion(+)

--
2.53.0

Comments

Laurent Pinchart Feb. 20, 2026, 2:45 p.m. UTC | #1
On Fri, Feb 20, 2026 at 03:12:16PM +0100, Barnabás Pőcze wrote:
> A "small vector" implementation has been introduced in the latest version
> of pybind11 (3.0.2), which might `offsetof()` on a non standard layout type.
> This triggers the `invalid-offsetof` warning.
> 
> So disable it for the python binding.
> 
> Link: https://github.com/pybind/pybind11/pull/5824
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>

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

> ---
>  src/py/libcamera/meson.build | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build
> index b0bd291fa..6c3b66bc5 100644
> --- a/src/py/libcamera/meson.build
> +++ b/src/py/libcamera/meson.build
> @@ -53,6 +53,7 @@ pycamera_deps = [
> 
>  pycamera_args = [
>      '-fvisibility=hidden',
> +    '-Wno-invalid-offsetof',
>      '-Wno-shadow',
>      '-DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT',
>  ]

Patch
diff mbox series

diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build
index b0bd291fa..6c3b66bc5 100644
--- a/src/py/libcamera/meson.build
+++ b/src/py/libcamera/meson.build
@@ -53,6 +53,7 @@  pycamera_deps = [

 pycamera_args = [
     '-fvisibility=hidden',
+    '-Wno-invalid-offsetof',
     '-Wno-shadow',
     '-DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT',
 ]