[libcamera-devel] [PATCH] meson.build: Silence the C99 designators warning

Niklas Söderlund niklas.soderlund at ragnatech.se
Thu Feb 13 13:05:35 CET 2020


Hi Laurent,

Thanks for your patch.

On 2020-02-13 01:54:51 +0200, Laurent Pinchart wrote:
> We use array designators for array initialization, which is a C99
> extension. clang-10 warns about it, causing a build failure.
> 
> As this is a useful extension, silence the warning. This needs to be
> done only if the compiler supports the -Wno-c99-designator argument,
> otherwise a -Wunknown-warning-option will be generated.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>

> ---
>  meson.build | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/meson.build b/meson.build
> index 0bbd24b2a295..aceba997aebd 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -60,6 +60,12 @@ if cc.get_id() == 'clang'
>      endif
>  endif
>  
> +if cc.has_argument('-Wno-c99-designator')
> +    common_arguments += [
> +        '-Wno-c99-designator',
> +    ]
> +endif
> +
>  c_arguments += common_arguments
>  cpp_arguments += common_arguments
>  
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

-- 
Regards,
Niklas Söderlund


More information about the libcamera-devel mailing list