From nobody Sun Feb 8 02:41:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1596473862; cv=none; d=zohomail.com; s=zohoarc; b=QoOZOggsFNWbJVAlyaMPQ7D/5TkiOkJZNE8adGoG4xkHWw82ytoKrbOuoaAnJnVLfDwE6Zo9NmeXdVkfEuo8nqCovIPSgQnppg06f/Tp42jx2MrzMhYZHigvQBcw2hJOs7BPs/pPPlQxvK27N+vtbgRKXdZtLgBWXZs7GSoqqg8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596473862; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MrrOxXXTmZC166hOzEMuXnDh3gDdBpQ/XM8eWs9LThU=; b=Ujv9m/xxKzLAq/3sDD+AtQed5aBL48hqjAwtkskeYYtCGg0IXuHmRh857oJNy35ysBq4fqA/dnPuDgS+SFPy49B5tXGr7uTdvUz4SqK5UTIRS+mOgn+Rp2q8+Z8DCKYt5dKI6VFYj76Cw9KjkzXYVg2q0og+eEPRmNmNv9EJtDE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1596473862681743.8364311859035; Mon, 3 Aug 2020 09:57:42 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-381-Nptl4zZ_Pe6-RNiJ1tBlHw-1; Mon, 03 Aug 2020 12:57:38 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BF45A8017FB; Mon, 3 Aug 2020 16:57:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9C8F4100E870; Mon, 3 Aug 2020 16:57:31 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 68A2C9A11E; Mon, 3 Aug 2020 16:57:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 073GvS4N007833 for ; Mon, 3 Aug 2020 12:57:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 54D4F71773; Mon, 3 Aug 2020 16:57:28 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.40.208.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9AEC571770 for ; Mon, 3 Aug 2020 16:57:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596473861; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=MrrOxXXTmZC166hOzEMuXnDh3gDdBpQ/XM8eWs9LThU=; b=aDYosDMAGxTRKWr/hmT/Y7z2ewAoz9F+NUe5dz3R824xtWJMTt0huw2EU17TWMq3/wFiIk IW+CSwampDoUBFz2ezixzso2AYDHrr+/YyrFZBPvC2lx7q4RdNKG2kRMuOzzqKuRhHGrG2 p/G9wAFVEUjjy52Rcp3JXl7hNMQAWHs= X-MC-Unique: Nptl4zZ_Pe6-RNiJ1tBlHw-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH RFC 15/19] util: xml: use pragma in VIR_XPATH_NODE_AUTORESTORE Date: Mon, 3 Aug 2020 18:56:52 +0200 Message-Id: <367d920825d55cff3201b69ac4e8871da17cf182.1596473604.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The VIR_XPATH_NODE_AUTORESTORE contains an ignore_value statement to silence an unused variable warning on clang. Use a pragma instead, which is not a statement. Signed-off-by: J=C3=A1n Tomko --- src/internal.h | 5 +++++ src/util/virxml.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/internal.h b/src/internal.h index 3bab6b4bfe..3aa3c6ca67 100644 --- a/src/internal.h +++ b/src/internal.h @@ -189,6 +189,11 @@ _Pragma ("GCC diagnostic push") #endif =20 +/* Where ignore_value cannot be used because it's a statement */ +#define VIR_WARNINGS_NO_UNUSED_VARIABLE \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wunused-variable\"") + #define VIR_WARNINGS_RESET \ _Pragma ("GCC diagnostic pop") =20 diff --git a/src/util/virxml.h b/src/util/virxml.h index 886d1e025f..0301f15308 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -241,9 +241,10 @@ G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virXPathContextNodeSa= ve, virXPathContextNodeRes * node pointer is reset to the original value when this macro was used. */ #define VIR_XPATH_NODE_AUTORESTORE(_ctxt) \ + VIR_WARNINGS_NO_UNUSED_VARIABLE \ g_auto(virXPathContextNodeSave) _ctxt ## CtxtSave =3D { .ctxt =3D _ctx= t,\ .node =3D _ctxt-= >node}; \ - ignore_value(&_ctxt ## CtxtSave) + VIR_WARNINGS_RESET =20 G_DEFINE_AUTOPTR_CLEANUP_FUNC(xmlDoc, xmlFreeDoc); G_DEFINE_AUTOPTR_CLEANUP_FUNC(xmlXPathContext, xmlXPathFreeContext); --=20 2.26.2