[v16,55/60] vhost: disable warning about use of VLAs

Message ID 1736821958-3295-56-git-send-email-andremue@linux.microsoft.com (mailing list archive)
State Changes Requested
Delegated to: David Marchand
Headers
Series remove use of VLAs for Windows |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Andre Muezerie Jan. 14, 2025, 2:32 a.m. UTC
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 <andremue@linux.microsoft.com>
---
 lib/vhost/meson.build | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
  

Patch

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