[libvirt PATCH] Set -Wno-incompatible-pointer-types-discards-qualifiers

Andrea Bolognani abologna at redhat.com
Thu Nov 12 10:46:04 UTC 2020


On Thu, 2020-11-12 at 09:41 +0000, Daniel P. Berrangé wrote:
> With CLang we're getting failures from cats in GLib macros

s/CLang/Clang/

> ../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.

Same here.

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

And here.

  Reviewed-by: Andrea Bolognani <abologna at redhat.com>

Was the issue reported against GLib?

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvir-list mailing list