From nobody Mon Feb 9 20:35:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1769792706; cv=none; d=zohomail.com; s=zohoarc; b=TuXU9Ez7yC4xKKYnGhfK8AQVMJL5AN8Fu6wzfVxby72D1BZc/abWEQG2tKprz3HLTSU37fD7WqIW3xshTlcn8xKxIAUgSYpd5vX5pqeXomGGybLvqkKQ1HV8h6ZJF0eQpXPXbySScPNPvCkdGHtMACUZ2XatlU8ICF6o3fF2TE4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769792706; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hEgcS586WoXQ1bA7kiDLx0TFML9LLxwYDy+VF81ztcM=; b=J3q4I/UhRe1uhJIYXm6r+WVcZUwnG9VJi2qH0Rff9VHeLtUcgCOdz2gzr+P/cuBKxg70EEe5TbNhi3OTcbfjpWVIzzCbTsmZl1IQe81puPvbUBfCtBfE1cCmHgygQ1gSmH7v/wjFX9z80DAaAkeAJBQ6bp5ZvLRUDt1vjIVrOOk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17697927063471022.9493397847227; Fri, 30 Jan 2026 09:05:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vlrvC-0000er-86; Fri, 30 Jan 2026 12:04:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vlrvA-0000eV-SF for qemu-devel@nongnu.org; Fri, 30 Jan 2026 12:04:36 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vlrv9-0001hp-EA for qemu-devel@nongnu.org; Fri, 30 Jan 2026 12:04:36 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4806f3fc50bso24004925e9.0 for ; Fri, 30 Jan 2026 09:04:35 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48066bee687sm414400655e9.5.2026.01.30.09.04.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 30 Jan 2026 09:04:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769792673; x=1770397473; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hEgcS586WoXQ1bA7kiDLx0TFML9LLxwYDy+VF81ztcM=; b=TfLTpYKNAxkoeXQtzxjwa8XRIWyO6BbTPunhgMq26uBwP8IrQlYz0gMkdTKBPDW9ew 0rvN5ON4+Ofyv4/CBywjfVV/r6tiF715IKEKDLYh7CONESL0fhgm2qjpu8IrmFPO82Us majwxYFJ0PgO0lmXGDIfrPKqQyWdcV0k041PdNn04NqagstxmRTZ5Qft/qvhRgwxJK5U M8B1GVYxydFFx4bR3H3uVh4D2PmoJFTAAQLuntKJ7yKxblIDJbnBnd9lgM2ca0/B0wEA qMIj85ktw3X4Y0sgipMoD9QVKCP2Bm1qdLm+aPgBWaiDZSA/m4JRL85bq/07cXpg5Cr1 P3kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769792673; x=1770397473; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hEgcS586WoXQ1bA7kiDLx0TFML9LLxwYDy+VF81ztcM=; b=uKsV3KaFSPeF7V/fllUN2YWE9n2TpgGNK2L+u5b/Fv3lwb8M7hvyBi9HOFYsoCZ5gu WSvrt1D7CoB6GGnvCOMrbPUryLQRIo7k8mWSvSXQirw1i5ZQlucsIa36eiqP6SwB5YKA +W2K+T7xCjzoVee8dbnBoiYwtVn39/QlbzHVLa4IViuUYV+FrDHErYLhV7wYc6Mu+ntI K695U038F4uuhbFmbvTCpHQ3NoPHG92luAiHJSW+L9RdO2rWfcgzbt2jZiLSAOMqAOjS AmPW/H8Spx3QS3T8Rpb1kTCrvq/+xqECfkR0Pcaqgikptetw3yxUwt9mNXlGb0xUYe1K 4hdA== X-Gm-Message-State: AOJu0Yx0i8FjInUD3QRIr7Lk72ZGskEDPe7aGqnKJuqUlNxsiks+q9mV vK8sBtbhdZXG1ZHZpnViSa7fvyGbK/XXPqsDEkdh7hjNBT8vqy54P6L8iYb+luiwa4qhQLuY49J COuPYXX0= X-Gm-Gg: AZuq6aK9/YyzT97lYBhaQe/WyzmVyzRTdaXE72ULt5zd2TlYkUVoaKSg1Kkg66m8uXR ZyeEv8MUJlbDyG8TlFDCsa7mVt+/p9HagROJnQO78o3mwOqQWtsan5ZjRFarx2S5lhAZErJOtlX hoHKJjxvm2a0rxc4wE8YRLd17TTIV/3ipuasvkO9PInuWWzUWxccMMHyiR0JtmT382sdPtfVWLK HZLFoJ42x+PZTjzyJ8q2PVj8dgy7ZWctCxz+lmjSVw8h1pk8j2mPv0U7g50kqTy4SCuB+30gGxm IZ7NbmOJ+qpUCyMpKtSg1uY9tKPmT+bjLLwgs47FoBqG8cDeJWvckcX4B4sZNaOFQED8goU3WOw dJgVuPcpsoTD484bQs7TZHgtkAI3bp51CHvr/b5eaYSg0wBEW+8gGhkmfXnhpDvBNno06KpgXgD I7kfn3MZFLPzy2c+5Pg8opuvrNK1cUhUUEXJNyBUVYcijzDmExmu2zX97Vsv6q X-Received: by 2002:a05:600c:4e87:b0:477:b734:8c53 with SMTP id 5b1f17b1804b1-482db46557cmr41828305e9.12.1769792673568; Fri, 30 Jan 2026 09:04:33 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , Roman Kiryanov , Paolo Bonzini , Peter Maydell , Eric Blake , Will Hollins , jpcottin@google.com, jansene@google.com Subject: [PATCH 2/2] docs/devel: Mention enum typedefs forward-declaration is not allowed Date: Fri, 30 Jan 2026 18:04:17 +0100 Message-ID: <20260130170417.43356-3-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260130170417.43356-1-philmd@linaro.org> References: <20260130170417.43356-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1769792707821158500 Do not allow enum typedef forward-declaration to comply with C99 standard chapter =C2=A76.7.2.2 point 4: Each enumerated type shall be compatible with char, a signed integer type, or an unsigned integer type. The choice of type is implementation-defined, but shall be capable of representing the values of all the members of the enumeration. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- docs/devel/style.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/devel/style.rst b/docs/devel/style.rst index 12e509d10de..5ab5c21447d 100644 --- a/docs/devel/style.rst +++ b/docs/devel/style.rst @@ -416,6 +416,17 @@ definitions instead of typedefs in headers and functio= n prototypes; this avoids problems with duplicated typedefs and reduces the need to include headers from other headers. =20 +Enumeration (enum) type can not be forward declared as typedef, because +C compilers should be able to know the size of enums before hand. Simply +define the typedef along with the enum: + +.. code-block:: c + + typedef enum MyEnum { + FOO, + BAR, + } MyEnum; + Bitfields --------- =20 --=20 2.52.0