From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mx.groups.io with SMTP id smtpd.web10.4613.1675909207167810734 for ; Wed, 08 Feb 2023 18:20:07 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@bsdio.com header.s=fm2 header.b=Paw7cSen; spf=pass (domain: bsdio.com, ip: 66.111.4.29, mailfrom: rebecca@bsdio.com) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 56E035C02B6; Wed, 8 Feb 2023 21:20:04 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 08 Feb 2023 21:20:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdio.com; h=cc :content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm2; t=1675909204; x=1675995604; bh=SIWX5iwNLV Dt7v8mFfeu9c7vBVREtUZ7vI/Zr/Q0YOs=; b=Paw7cSenKCxRnY903n/E2gHl2m BTCa+E3oA5uIhhqgz0vgxZW/B2/jRNajOIqKfQX4X2w9I+PMD4f6ACderX4ITd+f iSzR/++d/o+XSUnWcpMHkjZMO3pTRQV4mf3S6KAIK0UXGQHA7U8cHNYNvVOWb7g3 iw0truFYieLoqW3bKObR93R8rqxGBYu0k4Nh4O0c4KpxKEV4R00Eu66Q8k0/aYJA d1zLMtFZgQXC7Fjces3nY8rINyjq/AuKbs2RZobVCXw5K8uDoSGQ+aC5Cmzt3Lfd P8gbSUkOZLjc1+WD+kgLL3Qx/+7+qlLHI74jrK2mkVoBWirF/U0MIt+57VcQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1675909204; x=1675995604; bh=SIWX5iwNLVDt7v8mFfeu9c7vBVRE tUZ7vI/Zr/Q0YOs=; b=hi1pzDSUFnq6QBKzKOLkcw6J0mRTOxd0+QGT61dQe/6g MC7yVchEKfnDhSyP0So2HQVrLwAFLguGYpdXOIRRh3sdGx/7p/1GuVH1h37vx2ZS s+AAftdxsmS7q7mm5Lgh3dj4VaSw571nZN8cG+irdpEOFYqd7gkM0r6WbsXx2CiJ EM24uWvP5uGxcI70BGgLK2EL0E/B+MhTO5ogAeODJ7I5P7M03Ij67Q26w/SKiVVz ZjkJ5vQpAt43dVUhDOCQv/UQybAs0+aEunuU0Ma1gAoHv93Hdyo79vCG3963+ZGF xMWq0Ct9XSou+rO3bs9bVWiZ5e2doWa5ajTeaDM2Lg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudehuddgudeggecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfvhffutgfgsehtkeertddtfeejnecuhfhrohhmpeftvggsvggt tggrucevrhgrnhcuoehrvggsvggttggrsegsshguihhordgtohhmqeenucggtffrrghtth gvrhhnpedvtdeiffelfffgvdevteekhffgudfhhfelvdfgvefhkeefjeeufeduleelkeeu feenucffohhmrghinhepghhithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprhgvsggvtggtrgessghsughiohdrtghomh X-ME-Proxy: Feedback-ID: i5b994698:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Feb 2023 21:20:03 -0500 (EST) Message-ID: <36f37eb3-05de-64c3-833e-f625376b6f70@bsdio.com> Date: Wed, 8 Feb 2023 19:20:02 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 To: "devel@edk2.groups.io" , Michael D Kinney , Liming Gao From: "Rebecca Cran" Subject: Enum size checks in Base.h (UINT32 not ISO C compatible) Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit In commit 6440385b17def888544c2454ffba58384b929a22 (https://github.com/tianocore/edk2/commit/6440385b17def888544c2454ffba58384b929a22) enum size checks were added. However, according to gcc, ISO C restricts the size of enum values to int; building with -std=c11 -pedantic results in the error: MdePkg/Include/Base.h:812:28: error: ISO C restricts enumerator values to range of ‘int’ [-Werror=pedantic] 812 | __VerifyInt32EnumValue = 0xffffffff Replacing 0xffffffff with 0x7fffffff fixes the problem. It looks like this might change in C23, but since the use of _Static_assert in Base.h we require at least C11 (and I suspect most compilers aren't C23 compliant) which states: "The expression that defines the value of an enumeration constant shall be an integer constant expression that has a value representable as an int. [Section 6.7.2.2]" The UEFI Specification appears to say we require an INT32 (i.e. a signed int) so is the existing code wrong? -- Rebecca Cran