From: Daniel P. Berrangé Date: Thu, 12 Nov 2020 09:36:58 +0000 (+0000) Subject: Set -Wno-incompatible-pointer-types-discards-qualifiers X-Git-Tag: v6.10.0-rc1~212 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b3710e9a2af402a2b620de570b062294e11190eb;p=thirdparty%2Flibvirt.git Set -Wno-incompatible-pointer-types-discards-qualifiers 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é --- 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',