From 461e7ac873cf0def6b3dd6c7905f3c5b65734280 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 13 Feb 2020 00:38:00 +0200 Subject: meson.build: Silence the C99 designators warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Kieran Bingham Reviewed-by: Niklas Söderlund --- meson.build | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/meson.build b/meson.build index 0bbd24b2..c6e6a934 100644 --- a/meson.build +++ b/meson.build @@ -60,6 +60,15 @@ if cc.get_id() == 'clang' endif endif +# We use C99 designated initializers for arrays as C++ has no equivalent +# feature. Both gcc and clang support this extension, but recent +# versions of clang generate a warning that needs to be disabled. +if cc.has_argument('-Wno-c99-designator') + common_arguments += [ + '-Wno-c99-designator', + ] +endif + c_arguments += common_arguments cpp_arguments += common_arguments -- cgit v1.2.1