From b3710e9a2af402a2b620de570b062294e11190eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Thu, 12 Nov 2020 09:36:58 +0000 Subject: [PATCH] Set -Wno-incompatible-pointer-types-discards-qualifiers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With Clang we're getting failures from casts in GLib macros ../dist-unpack/libvirt-6.10.0/src/util/vireventthread.c:35:1: error: passing 'typeof (*(&g_define_type_id__volatile)) *' (aka 'volatile unsigned long *') to parameter of type 'gsize *' (aka 'unsigned long *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers] G_DEFINE_TYPE(virEventThread, vir_event_thread, G_TYPE_OBJECT) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The cast is valid and there's no way for libvirt to workaround the issue, so we must disable this Clang warning flag. Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani Signed-off-by: Daniel P. Berrangé --- meson.build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meson.build b/meson.build index f2e4f2cc23..5fec644fc7 100644 --- a/meson.build +++ b/meson.build @@ -405,6 +405,9 @@ cc_flags += [ # so use this CLang-specific arg to keep it quiet '-Wno-typedef-redefinition', + # Clang complains about casts in G_DEFINE_TYPE(...) + '-Wno-incompatible-pointer-types-discards-qualifiers', + # We don't use -Wc++-compat so we have to enable it explicitly '-Wjump-misses-init',