From dfbaf4dd81cd19779bfa810b0f838a10c3836963 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Sun, 14 Nov 2021 18:34:51 -0600 Subject: meson: fix -Werror=format-security flag This test fails because the compiler object does not have -Wformat when it tries this flag. To fix this this, we have to pass both -Wformat and -Werror=format-security at the same time during the test. This requires us to use has_multi_arguments so this flag needs to be pulled out of this array and tested separately. --- meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index b44b161584..ed48fd6aa0 100644 --- a/meson.build +++ b/meson.build @@ -256,7 +256,6 @@ test_flags = ['-Werror=implicit-function-declaration', '-Wdisabled-optimization', '-Wstrict-prototypes', '-Wno-format-zero-length', - '-Werror=format-security', '-Wno-redundant-decls', '-Wvla', '-Wno-format-truncation', @@ -265,6 +264,10 @@ test_flags = ['-Werror=implicit-function-declaration', flags += cc.get_supported_arguments(test_flags) +if cc.has_multi_arguments('-Wformat', '-Werror=format-security') + flags += '-Werror=format-security' +endif + if cc.get_id() == 'gcc' gcc_flags = ['-Wundef', '-Wmissing-prototypes', '-Wshadow', '-Wno-switch', '-Wparentheses', '-Wpointer-arith', -- cgit v1.2.3