From b1646a2506f4fab5139349dfd4a7ae2385a6e8b0 Mon Sep 17 00:00:00 2001 From: Sean McAllister Date: Tue, 7 Oct 2025 08:37:58 -0600 Subject: [PATCH] Add -Wno-gnu-zero-variadic-macro-arguments to nowarn options. Check that the compiler supports it. Variadic macros of the form: FOO(a, b, c, ## __VA_ARGS__) are a gnu extension, where an empty set of arguments will automatically supress the trailing comma. Clang supports this also, but if this flag isn't set it will generate a warning, and with -Werror, fail the build. We know the usage is intentional and safe so disable these warnings. --- meson.build | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 864c407f6b..5df06033e2 100644 --- a/meson.build +++ b/meson.build @@ -23,12 +23,15 @@ is_subproj = meson.is_subproject() tests_enabled = get_option('tests').disable_auto_if(is_subproj).allowed() examples_enabled = get_option('examples').disable_auto_if(is_subproj).allowed() -hwy_nowarn_args = [] +cpp = meson.get_compiler('cpp') + +hwy_nowarn_args = cpp.get_supported_arguments([ + '-Wno-gnu-zero-variadic-macro-arguments', # Disable gnu variadic macro warning. +]) + hwy_cpp_args = [] hwy_link_args = [] -cpp = meson.get_compiler('cpp') - pkg = import('pkgconfig') have_emscripten = cpp.has_define('__EMSCRIPTEN__')