This path is known to make use of VLAs, so we need to disable warnings
issued for VLAs to prevent the build from breaking.

Signed-off-by: Andre Muezerie <andre...@linux.microsoft.com>
---
 lib/vhost/meson.build | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/lib/vhost/meson.build b/lib/vhost/meson.build
index 51bcf17244..4539bedab4 100644
--- a/lib/vhost/meson.build
+++ b/lib/vhost/meson.build
@@ -16,11 +16,19 @@ elif (toolchain == 'icc' and 
cc.version().version_compare('>=16.0.0'))
     cflags += '-DVHOST_ICC_UNROLL_PRAGMA'
 endif
 dpdk_conf.set('RTE_LIBRTE_VHOST_POSTCOPY', 
cc.has_header('linux/userfaultfd.h'))
-cflags += [
-        '-fno-strict-aliasing',
-        '-Wno-address-of-packed-member',
+
+extra_flags = [
+    '-fno-strict-aliasing',
+    '-Wno-address-of-packed-member',
+    '-Wno-vla'
 ]
 
+foreach arg: extra_flags
+    if cc.has_argument(arg)
+        cflags += arg
+    endif
+endforeach
+
 sources = files(
         'fd_man.c',
         'iotlb.c',
-- 
2.47.0.vfs.0.3

Reply via email to