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 <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2020-11-12 09:36:58 +00:00
parent db98d17709
commit b3710e9a2a

View File

@ -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',