From 788fdd44a73edf8830369ad15999c82ccec8617a Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Sun, 3 Mar 2024 06:42:42 +0100 Subject: [PATCH] Hide C compiler warnings about unused items, explain some others MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are numerous, but harmless -- that's just how Vala → C generation works. It takes attention away from the more interesting warnings. Add explanation and bug reference for the others. Fixes #226 --- meson.build | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index a7fbe0d..617d25b 100644 --- a/meson.build +++ b/meson.build @@ -39,14 +39,19 @@ g_ir_compiler = find_program('g-ir-compiler', required: false) # generated vala code triggers tons of these add_project_arguments( cc.get_supported_arguments( + # Vala doesn't have `const void*`, or a way to selectively #pragma these in the code '-Wno-error=discarded-qualifiers', + # mostly const dropping and dropped "volatile" in fully autogenerated code; + # upstream Vala does not support fixing this warning '-Wno-error=incompatible-pointer-types', + # https://gitlab.gnome.org/GNOME/vala/-/issues/1529 '-Wno-error=pointer-sign', - '-Wno-error=unused-but-set-variable', - '-Wno-error=unused-function', - '-Wno-error=unused-label', - '-Wno-error=unused-value', - '-Wno-error=unused-variable' + # "mostly harmless", fallout from Vala C code template generation, C compiler will optimize away + '-Wno-unused-but-set-variable', + '-Wno-unused-function', + '-Wno-unused-label', + '-Wno-unused-value', + '-Wno-unused-variable' ), language: 'c') # HACK: vala doesn't support declaring const arguments, so we get a lot of errors