From nobody Sun Feb 8 23:36:59 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1548283684376956.9942337223916; Wed, 23 Jan 2019 14:48:04 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6863030AF50; Wed, 23 Jan 2019 22:48:02 +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 2F82E2655A; Wed, 23 Jan 2019 22:48:02 +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 D44D13F605; Wed, 23 Jan 2019 22:48:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0NMlsjU011144 for ; Wed, 23 Jan 2019 17:47:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4392D67141; Wed, 23 Jan 2019 22:47:54 +0000 (UTC) Received: from worklaptop.redhat.com (ovpn-120-34.rdu2.redhat.com [10.10.120.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 480A765F72; Wed, 23 Jan 2019 22:47:53 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Wed, 23 Jan 2019 17:46:13 -0500 Message-Id: <55760abbf66bfa58e1857d02d1338fdc4b7494b9.1548283535.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Andrea Bolognani Subject: [libvirt] [PATCH 6/9] Require a semicolon for VIR_ENUM_IMPL calls 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 23 Jan 2019 22:48:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Move the verify() statement to the end of the macro and drop the semicolon, so the compiler will require callers to add a semicolon. Signed-off-by: Cole Robinson --- src/util/virutil.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virutil.h b/src/util/virutil.h index d5adab61e2..f8d8d85d27 100644 --- a/src/util/virutil.h +++ b/src/util/virutil.h @@ -82,7 +82,6 @@ const char *virEnumToString(const char *const*types, =20 # define VIR_ENUM_IMPL(name, lastVal, ...) \ static const char *const name ## TypeList[] =3D { __VA_ARGS__ }; \ - verify(ARRAY_CARDINALITY(name ## TypeList) =3D=3D lastVal); \ const char *name ## TypeToString(int type) { \ return virEnumToString(name ## TypeList, \ ARRAY_CARDINALITY(name ## TypeList), \ @@ -93,6 +92,7 @@ const char *virEnumToString(const char *const*types, ARRAY_CARDINALITY(name ## TypeList), \ type); \ } \ + verify(ARRAY_CARDINALITY(name ## TypeList) =3D=3D lastVal) =20 # define VIR_ENUM_DECL(name) \ const char *name ## TypeToString(int type); \ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list