[PATCH 2/2] meson: Enable the -Wnon-virtual-dtor compiler option

Milan Zamazal mzamazal at redhat.com
Tue Feb 25 09:56:13 CET 2025


Laurent Pinchart <laurent.pinchart at ideasonboard.com> writes:

> A base class with virtual functions and a non-virtual public destructor
> is prone to undefined behaviourif deleted from a pointer to the base.
> Enable the -Wnon-virtual-dtor warning to report those issues.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

Reviewed-by: Milan Zamazal <mzamazal at redhat.com>

> ---
>  meson.build | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/meson.build b/meson.build
> index 5270f626f2fb..f8d32dcf8d7a 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -110,7 +110,9 @@ common_arguments = [
>  ]
>  
>  c_arguments = []
> -cpp_arguments = []
> +cpp_arguments = [
> +    '-Wnon-virtual-dtor',
> +]
>  
>  cxx_stdlib = 'libstdc++'



More information about the libcamera-devel mailing list