From nobody Tue Feb 10 23:00:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1650655563; cv=none; d=zohomail.com; s=zohoarc; b=FyOtNmAGtnBNun0HgFngt9Qh9IhpgWsVYqgBzX8HnAayHQpPIxBoC4oYt+OrBNYOVs761Q5xaweEYZwpwPlz4U3/wDHg5wpaTRRoHWv4qqSVS1So5XAihwlXQY+0R8VxN/RMn1gQHN8vSRCkzqYleVLUMyRmKvIKMxz7U56Lfyc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650655563; 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=Lpdn4TXGMkwtWOfTvCIwkARr9RWiKG71OUyRgU4YEFU=; b=A9KgoEDbvx9DxllRYZDf3xBAQ4IOS6HDtoWpNcCpDadPVu6FRt2Bzx43RyIRHDWRlqZkcSflvxMH/0a6pE7GLCHfgvmCz4df+GVL8pz1kWZNqyD0UvAoTAhron9HXgj3ToH4G56xyx3A4GV6Q5I/3AEHL6J8a0dC2gbWKSELqJs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1650655563360508.88390494125645; Fri, 22 Apr 2022 12:26:03 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-640-Y1vcRS5KPpO4F_xwhZv_tw-1; Fri, 22 Apr 2022 15:25:01 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A8EC53C16193; Fri, 22 Apr 2022 19:24:58 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 92BBB40CF918; Fri, 22 Apr 2022 19:24:58 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 05C621940365; Fri, 22 Apr 2022 19:24:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C566C1940359 for ; Fri, 22 Apr 2022 19:24:56 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id BB6252024CCB; Fri, 22 Apr 2022 19:24:56 +0000 (UTC) Received: from tapioca.home (unknown [10.40.194.99]) by smtp.corp.redhat.com (Postfix) with ESMTP id 252772024CC3 for ; Fri, 22 Apr 2022 19:24:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650655562; 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=Lpdn4TXGMkwtWOfTvCIwkARr9RWiKG71OUyRgU4YEFU=; b=EKRsPM0r3h1wNvXqBtWP62uKaQdxBfOmKHil9UF37+L3JJSSBsh3TVveDonMjOge/21lq7 HaU3YNZebAFJwsadUc+OCXKeeqUkyD4UKkEXhnTMg8xYM1XfApoPvGwrPOgcddoa01XQOP vqMJtTuLCSJmF7U0rWg2Xy3lf1WNCWA= X-MC-Unique: Y1vcRS5KPpO4F_xwhZv_tw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Victor Toso To: libvir-list@redhat.com Subject: [PATCH v4 14/19] scripts: apibuild: fix parsing block comments from typedef enum Date: Fri, 22 Apr 2022 21:23:39 +0200 Message-Id: <20220422192344.830350-15-victortoso@redhat.com> In-Reply-To: <20220422192344.830350-1-victortoso@redhat.com> References: <20220422192344.830350-1-victortoso@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650655565583100001 Content-Type: text/plain; charset="utf-8" Removed the TODO as we can rely to the serialize_typedef() the job to report missing comments. Signed-off-by: Victor Toso --- scripts/apibuild.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/apibuild.py b/scripts/apibuild.py index 19e897b1ba..ddc2fff7af 100755 --- a/scripts/apibuild.py +++ b/scripts/apibuild.py @@ -1145,6 +1145,12 @@ class CParser: def parseTypedef(self, token): if token is None: return None + + # With typedef enum types, we can have comments parsed before the + # enum themselves. The parsing of enum values does clear the + # self.comment variable. So we store it here for later. + typedef_comment =3D self.comment + token =3D self.parseType(token) if token is None: self.error("parsing typedef") @@ -1168,7 +1174,7 @@ class CParser: "struct", type) base_type =3D "struct " + name else: - # TODO report missing or misformatted comments + self.comment =3D typedef_comment info =3D self.parseTypeComment(name, 1) self.index_add(name, self.filename, not self.is_he= ader, "typedef", type, info) --=20 2.35.1