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

Laurent Pinchart laurent.pinchart at ideasonboard.com
Thu Feb 13 00:54:51 CET 2020


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>
---
 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



More information about the libcamera-devel mailing list