From nobody Tue Feb 10 12:39:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1649969472; cv=none; d=zohomail.com; s=zohoarc; b=GEfRuieaJQrsTBOOgGMjgcuSnZJqqJ9CEXKPfVjaVhQYaM+AS8BY2HmQ0RCoPGK7ry9G+/vgmpqvGlBhkQuNWbnFjquPNk8FG38nJWf9tmDiGqSlJU4a02f1SXtHcW8rUCJsKoVV/lJ5GhZHLAxOi8jsdPDst713RwCY5JzBfzU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649969472; 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=eGOwJAn+7uL2UyG56A4vnt3TcvP2inVH6L9bzyDH77E=; b=DrfSC45De4t/O3UdXO7NXKkrq//e64cdiCOdIcZeYV5dfnmy8TFBCZhnOlKAUe5yeVB08bljY+tWrQJLZyAN6b4Al7uICalQXcW1ejAEzuIfC5Tog0sp5BkyjJbvmEw1UPbDUB9nM8qKb1gdtl+QKdfua+ntix7ZoUktNU6PuEY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1649969472897163.10013917240633; Thu, 14 Apr 2022 13:51:12 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-365-eFRtsOalNqSkmEp-sjR-qQ-1; Thu, 14 Apr 2022 16:51:07 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 620E48E1FFD; Thu, 14 Apr 2022 20:50:47 +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 447EDC4C7B6; Thu, 14 Apr 2022 20:50:47 +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 E6DD1193F6DB; Thu, 14 Apr 2022 20:50:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E3147194034A for ; Thu, 14 Apr 2022 20:50:44 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D7FF52167D68; Thu, 14 Apr 2022 20:50:44 +0000 (UTC) Received: from tapioca.home (unknown [10.40.193.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65A702167D6B for ; Thu, 14 Apr 2022 20:50:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649969471; 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=eGOwJAn+7uL2UyG56A4vnt3TcvP2inVH6L9bzyDH77E=; b=W+unxuWJn+LWw7474/aFsuQUvH7Ct/X3qrSNGcv0HRLJAs2Kpb4Onch/ufnV04cW4LnrXJ V3BazDz90/cNouFUG1V9Aww4WoZLxhbEy8YCbPH1waY/uN5p/dy9a4PfcG4C0l1RAN52LY sWGoCifBFVli4BwPIACoGXblvpUKiWo= X-MC-Unique: eFRtsOalNqSkmEp-sjR-qQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Victor Toso To: libvir-list@redhat.com Subject: [PATCH v2 26/34] scripts: apibuild: fix parsing block comments from typedef enum Date: Thu, 14 Apr 2022 22:47:37 +0200 Message-Id: <20220414204745.108966-27-victortoso@redhat.com> In-Reply-To: <20220414204745.108966-1-victortoso@redhat.com> References: <20220414204745.108966-1-victortoso@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 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.85 on 10.11.54.8 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: 1649969475306100001 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 4e9f802bde..5335670c1c 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