[libvirt PATCH v2] meson: avoid bogus warnings from clang and g_autoptr

Pavel Hrdina phrdina at redhat.com
Wed Sep 1 13:17:41 UTC 2021


On Wed, Sep 01, 2021 at 01:29:25PM +0100, Daniel P. Berrangé wrote:
> Clang has previously had trouble with G_DEFINE_AUTOPTR_CLEANUP_FUNC
> generated code, thinking it was unused. We turn off -Wunused-function
> to avoid tripping up on that with CLang.
> 
> New Clang has started having trouble with g_autoptr now too. In usage
> scenarios where the variable is set, but never again read, it thinks
> it is unused not realizing the destructor has useful side effects.
> For this we have to skip -Wunused-but-set-variable on CLang.
> 
> Reviewed-by: Pavel Hrdina <phrdina at redhat.com>
> Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
> ---
>  build-aux/syntax-check.mk |  2 +-
>  meson.build               | 21 +++++++++++++++++++++
>  2 files changed, 22 insertions(+), 1 deletion(-)

Reviewed-by: Pavel Hrdina <phrdina at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210901/4fc8eda0/attachment-0001.sig>


More information about the libvir-list mailing list