From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 8D5BAD801B2 for ; Fri, 11 Oct 2024 03:42:04 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=qv62YeoBcWlPU6motSAxwVYKRXAJomVtvpbHOoE7yDc=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type; s=20240830; t=1728618124; v=1; x=1728877323; b=HS3AgsEGy4OIkHyM/PBtvYVq6k+IxbzNe0Ky/Kx8THES4WpTfxHfRpwV4Q/q93kvygAQvSic YKNUwdGSPoGsSg0hLwIQJrt88s05kSmPmfNFArcZ8WB/K6CotGWMrPGrEVf1+nO/gjAgn48mtIC nfh6x0zG8cyDvSi1MoV4sFAbndCJjHUfh71zkP5mbXRI2mQpToEEu2l1OxGMnrRCZv4p0yTBXOs p3dHVrqFXm/0xc2t2k6skH4PdmwSvxB7Ylm9WZKLU2a2xy248ya7rfDcjB9wjy5QvI/MIG8NGt6 BwFYUmcDfVvPjnhi+X/AVV5uQ0uXF8yqJmaQELHbxAVmg== X-Received: by 127.0.0.2 with SMTP id PEGiYY7687511xbnERtNfC81; Thu, 10 Oct 2024 20:42:03 -0700 X-Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.92.21.46]) by mx.groups.io with SMTP id smtpd.web10.3698.1728618122093661765 for ; Thu, 10 Oct 2024 20:42:02 -0700 X-Received: from CH3P221MB1368.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:1d6::18) by CH0P221MB0442.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:107::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Fri, 11 Oct 2024 03:41:58 +0000 X-Received: from CH3P221MB1368.NAMP221.PROD.OUTLOOK.COM ([fe80::3f3c:68ba:b302:6a38]) by CH3P221MB1368.NAMP221.PROD.OUTLOOK.COM ([fe80::3f3c:68ba:b302:6a38%7]) with mapi id 15.20.8048.013; Fri, 11 Oct 2024 03:41:58 +0000 From: "Sean" To: "devel@edk2.groups.io" , "rebecca@bsdio.com" , Michael Kinney , Oliver Smith-Denny CC: Rebecca Cran Subject: Re: [edk2-devel] [edk2-CCodingStandardsSpecification PATCH 1/1] Prefer use of `static` C keyword over EDK2 type `STATIC` Thread-Topic: [edk2-devel] [edk2-CCodingStandardsSpecification PATCH 1/1] Prefer use of `static` C keyword over EDK2 type `STATIC` Thread-Index: AQHbG3vXrzeEuq/2AU22zn/utVpQvbKA542R Date: Fri, 11 Oct 2024 03:41:58 +0000 Message-ID: References: <20241011012040.274642-1-rebecca@bsdio.com> In-Reply-To: <20241011012040.274642-1-rebecca@bsdio.com> Accept-Language: en-US X-Mentions: osde@linux.microsoft.com X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-reactions: allow x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CH3P221MB1368:EE_|CH0P221MB0442:EE_ x-ms-office365-filtering-correlation-id: fa438a93-617a-487e-6f26-08dce9a6a88f x-microsoft-antispam-message-info: =?us-ascii?Q?TCeQRCOuHX19DIok0BYQd7fgLYGz+r7ZgCNZPP188kUatkIzU4SEuRW5wV39?= =?us-ascii?Q?nkkXZpD1Dx6WDvn84kwveIjCJpYRMqZeprUX3JXF2y+OYkhCeRTorWYs9Tfx?= =?us-ascii?Q?ySIFltylJ3ZNEXBrfyh3uzxynZxmcAm4TJx6bcrtEMxs6a7TG2F0JtXIVRKx?= =?us-ascii?Q?iLOve/H/jLRZvTXagX8pdtuV703qGZb9cppx68VexJgbqhXtLpSjli7U4IFc?= =?us-ascii?Q?1FCAt5kBJpdbup/tDSY5UWvIqhDXF2QyeU6hBZr7NQgT4BCHrD4ArZlIdK38?= =?us-ascii?Q?6/uXQLoIV8LZ5TJ6rQ1niAg6fHlyfF3aXxV/Olke/8bpr+bobI8+dDmmYMTO?= =?us-ascii?Q?COgKvkITMEf8XRKaVx+okN23WUpngsIVckn3oRwQhmiMtKOd0o71EvvlZyCx?= =?us-ascii?Q?N8bjQ7KAm6N0EIsxXWFCSCORNOBpqXTEEcHfEOnu2up97K7vGmEzyAVeFWgl?= =?us-ascii?Q?pScXzL9PhINyt0SS30HPU+mgS7MUpzLz6vuunPPZYuSUUwnSpkfGN1lLXJ44?= =?us-ascii?Q?GMrWkNU71DhBCiKCryLL8hYIO1uq3DtTqDwsZorE9IH8dZ7EbSQHNnTxmGNb?= =?us-ascii?Q?ww4o9tqlYHt26uOVO3RT18r1OEVzzD0PIANX/GWPMgcMoyJr7MdM3vgmJazb?= =?us-ascii?Q?6ACZbfjYX2/b45r7Vdly8q2nGY8C4ERDZH5K42OAJyqHPK7t1eBjJsMLmV3C?= =?us-ascii?Q?Pzzj7fGrW+/qFJFUQwMuzgIVbWin/YUgGYOXool/0dwBNb45hr0LG8g7Br2x?= =?us-ascii?Q?33R0wxVA1hiphvyrwVQuBi7PlJHBQTXU6avz1QQGU1Hs9MYn/IyPkJUkN/cD?= =?us-ascii?Q?4mKFDoNx4/ytI8X3jfqZ9gg4tXV2AAfr9tIFtRFOPmyKeth/9euqrKYwiTr2?= =?us-ascii?Q?cauT8nE4zW7xU/khNxjyTVSmbjpaSn5SDXmGsFpQwZWfQonD5Ua9WF7ssujY?= =?us-ascii?Q?tnMfh3kaK+vS4RLAB9mgqtLVkXXYqvyReaks2VOxnLE=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?w0snRUdC0m7K97YZwvIDOn3OjzZ61RP4+hfOrLltPSOWet1ydcRHmWlSCdhq?= =?us-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LD6FYmgPYMEGv3JoVKATVuiyedwk4xsZkf/oN26E?= =?us-ascii?Q?qMjveGui/rPtD9gu8OxVSlawWjLEzP9bnXARHUiR/hov/h9H/waGoPDQe5bZ?= =?us-ascii?Q?qFuhJvqBJmRm/kRe6JvJjH35ZtfTuw600n9RNZorCvYNAMfGSOdgUyjFZDbc?= =?us-ascii?Q?HuvIZE5WCQqbr4xJIhLd7bHr7EVgRtdjq/l5HuE4Mid/w7z/yQPaui9BV0Gi?= =?us-ascii?Q?LjlghgbYcx5m1TNCq5LmhMI2ctSPaO40ZOG2VUr5XroGdlpvEsaGwxLkH6ty?= =?us-ascii?Q?0q1Fy+CPDxEQOHr8Vb8K22Gz0sz0KGzonqw78s9AXAWunNN4LPbW4uprdmrl?= =?us-ascii?Q?ytA/xTBGJCJlinWfR5d1?= MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH3P221MB1368.NAMP221.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: fa438a93-617a-487e-6f26-08dce9a6a88f X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2024 03:41:58.1452 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0P221MB0442 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Thu, 10 Oct 2024 20:42:02 -0700 Resent-From: spbrogan@outlook.com Reply-To: devel@edk2.groups.io,spbrogan@outlook.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: po8qYJOV7tFPdIOJqum8mFpOx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CH3P221MB1368AECCC8FE4995917369E8C8792CH3P221MB1368NAMP_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240830 header.b=HS3AgsEG; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=outlook.com (policy=none) --_000_CH3P221MB1368AECCC8FE4995917369E8C8792CH3P221MB1368NAMP_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I think @Oliver Smith-Denny has proposed k= eeping the macro STATIC as a way to enable cleaner and easier unit tests. D= id that get resolved? Thanks Sean ________________________________ From: devel@edk2.groups.io on behalf of Rebecca Cran= Sent: Thursday, October 10, 2024 6:20:39 PM To: Michael Kinney ; devel@edk2.groups.io Cc: Rebecca Cran Subject: [edk2-devel] [edk2-CCodingStandardsSpecification PATCH 1/1] Prefer= use of `static` C keyword over EDK2 type `STATIC` A while ago a decision was made on the edk2-devel mailing list that the `STATIC` EDK2 type should be replaced with the C keyword `static`. Update the Coding Specification to match. While here, remove the outdated section disallowing static functions since they're no longer a problem. Bump the revision to 2.4 and turn off the draft status. Signed-off-by: Rebecca Cran --- 5_source_files/54_code_file_structure.md | 8 +------- 5_source_files/56_declarations_and_types.md | 2 +- README.md | 3 ++- book.json | 4 ++-- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/5_source_files/54_code_file_structure.md b/5_source_files/54_c= ode_file_structure.md index 0c4d6a2..6decc60 100644 --- a/5_source_files/54_code_file_structure.md +++ b/5_source_files/54_code_file_structure.md @@ -269,7 +269,7 @@ other than at the top level of a file as specified by t= his document. #### 5.4.2.2 Static -An object declared `STATIC` has either file or block scope. +An object declared `static` has either file or block scope. ##### 5.4.2.2.1 Do not reuse an object or function identifier with static = storage duration. @@ -277,9 +277,3 @@ Throughout the set of source files defined within a sin= gle .inf file, do not reuse an identifier with static storage duration. The compiler may not be confused by this, but the user may confuse unrelated variables with the sa= me name. - -##### 5.4.2.2.2 Functions should not be declared STATIC. - -Some source-level debuggers are unable to resolve static functions. Until = it -can be verified that no one is dependent upon a debugger with this limitat= ion, -it is strongly recommended that functions not be declared static. diff --git a/5_source_files/56_declarations_and_types.md b/5_source_files/5= 6_declarations_and_types.md index ec1803d..77e3ce9 100644 --- a/5_source_files/56_declarations_and_types.md +++ b/5_source_files/56_declarations_and_types.md @@ -38,7 +38,7 @@ Any abstract type that is defined must be constructed from other abstract = types or from common EFI data types. -#### 5.6.1.2 The use of int, unsigned, char, void, static, long is a viola= tion of the coding convention. +#### 5.6.1.2 The use of int, unsigned, char, void, long is a violation of = the coding convention. The corresponding EFI types must be used instead. diff --git a/README.md b/README.md index 77cfdc8..b543bcf 100644 --- a/README.md +++ b/README.md @@ -114,4 +114,5 @@ Copyright (c) 2006-2017, Intel Corporation. All rights = reserved. | | [#425](https://bugzilla.tianocore.org/show_bug.cgi?id=3D425) = [CCS] clarify line breaking and indentation requirements for multi-line fun= ction calls | | | | [#1656](https://bugzilla.tianocore.org/show_bug.cgi?id=3D1656= ) Update all Wiki pages for the BSD+Patent license change with SPDX identif= iers | | | | [#607](https://bugzilla.tianocore.org/show_bug.cgi?id=3D607) = Document code comment requirements for spurious variable assignments = | | -| 2.3 | Add 4.2 Directory names section and update File names section= for the guidelines of module directory and file naming|September 2022|| +| 2.3 | Add 4.2 Directory names section and update File names section= for the guidelines of module directory and file naming = |September 2022| +| 2.4 | The use of the 'static' C keyword is now preferred over the E= DK2 type 'STATIC' = |October 2024| diff --git a/book.json b/book.json index d112b26..3ec7a93 100644 --- a/book.json +++ b/book.json @@ -1,8 +1,8 @@ { "variables" : { - "draft" : "yes", + "draft" : "no", "title" : "EDK II C Coding Standards Specification", - "version" : "Revision 2.2" + "version" : "Revision 2.4" }, "plugins": ["puml-aleung"], "pluginsConfig": {} -- 2.46.1 -=3D-=3D-=3D-=3D-=3D-=3D Groups.io Links: You receive all messages sent to this group. View/Reply Online (#120616): https://edk2.groups.io/g/devel/message/120616 Mute This Topic: https://groups.io/mt/108941574/1686594 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [spbrogan@outlook.com] -=3D-=3D-=3D-=3D-=3D-=3D -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#120617): https://edk2.groups.io/g/devel/message/120617 Mute This Topic: https://groups.io/mt/108941574/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --_000_CH3P221MB1368AECCC8FE4995917369E8C8792CH3P221MB1368NAMP_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
I think @Oliver Smith-Denny has proposed keeping the macro STATIC as a way= to enable cleaner and easier unit tests. Did that get resolved? 

Thanks
Sean

From: devel@edk2.groups.io = <devel@edk2.groups.io> on behalf of Rebecca Cran <rebecca@bsdio.co= m>
Sent: Thursday, October 10, 2024 6:20:39 PM
To: Michael Kinney <michael.d.kinney@intel.com>; devel@edk2.gr= oups.io <devel@edk2.groups.io>
Cc: Rebecca Cran <rebecca@bsdio.com>
Subject: [edk2-devel] [edk2-CCodingStandardsSpecification PATCH 1/1]= Prefer use of `static` C keyword over EDK2 type `STATIC`
 
A while ago a decision was made on the edk2-devel = mailing list that
the `STATIC` EDK2 type should be replaced with the C keyword `static`.

Update the Coding Specification to match. While here, remove the
outdated section disallowing static functions since they're no longer
a problem.

Bump the revision to 2.4 and turn off the draft status.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 5_source_files/54_code_file_structure.md    | 8 +-----= --
 5_source_files/56_declarations_and_types.md | 2 +-
 README.md          =             &nb= sp;            | 3 += +-
 book.json          =             &nb= sp;            | 4 += +--
 4 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/5_source_files/54_code_file_structure.md b/5_source_files/54_c= ode_file_structure.md
index 0c4d6a2..6decc60 100644
--- a/5_source_files/54_code_file_structure.md
+++ b/5_source_files/54_code_file_structure.md
@@ -269,7 +269,7 @@ other than at the top level of a file as specified by t= his document.
 

 #### 5.4.2.2 Static

 

-An object declared `STATIC` has either file or block scope.

+An object declared `static` has either file or block scope.

 

 ##### 5.4.2.2.1 Do not reuse an object or function identifier with st= atic storage duration.

 

@@ -277,9 +277,3 @@ Throughout the set of source files defined within a sin= gle .inf file, do not
 reuse an identifier with static storage duration. The compiler may no= t be

 confused by this, but the user may confuse unrelated variables with t= he same

 name.

-

-##### 5.4.2.2.2 Functions should not be declared STATIC.

-

-Some source-level debuggers are unable to resolve static functions. Until = it

-can be verified that no one is dependent upon a debugger with this limitat= ion,

-it is strongly recommended that functions not be declared static.

diff --git a/5_source_files/56_declarations_and_types.md b/5_source_files/5= 6_declarations_and_types.md
index ec1803d..77e3ce9 100644
--- a/5_source_files/56_declarations_and_types.md
+++ b/5_source_files/56_declarations_and_types.md
@@ -38,7 +38,7 @@
 Any abstract type that is defined must be constructed from other abst= ract types

 or from common EFI data types.

 

-#### 5.6.1.2 The use of int, unsigned, char, void, static, long is a viola= tion of the coding convention.

+#### 5.6.1.2 The use of int, unsigned, char, void, long is a violation of = the coding convention.

 

 The corresponding EFI types must be used instead.

 

diff --git a/README.md b/README.md
index 77cfdc8..b543bcf 100644
--- a/README.md
+++ b/README.md
@@ -114,4 +114,5 @@ Copyright (c) 2006-2017, Intel Corporation. All rights = reserved.
 |          | [#425](http= s://bugzilla.tianocore.org/show_bug.cgi?id=3D425) [CCS] clarify line breaki= ng and indentation requirements for multi-line function calls |  =           |

 |          | [#1656](htt= ps://bugzilla.tianocore.org/show_bug.cgi?id=3D1656) Update all Wiki pages f= or the BSD+Patent license change with SPDX identifiers   &nb= sp;    |        &nbs= p;   |

 |          | [#607](http= s://bugzilla.tianocore.org/show_bug.cgi?id=3D607) Document code comment req= uirements for spurious variable assignments     &n= bsp;            = ; |            |

-| 2.3      | Add 4.2 Directory names section and = update File names section for the guidelines of module directory and file n= aming|September 2022||

+| 2.3      | Add 4.2 Directory names section and = update File names section for the guidelines of module directory and file n= aming           &nbs= p;            &= nbsp;     |September 2022|

+| 2.4      | The use of the 'static' C keyword is= now preferred over the EDK2 type 'STATIC'     &nb= sp;            =             &nb= sp;            =             &nb= sp;            |Octo= ber 2024|

diff --git a/book.json b/book.json
index d112b26..3ec7a93 100644
--- a/book.json
+++ b/book.json
@@ -1,8 +1,8 @@
 {

   "variables" : {

-    "draft"   : "yes",

+    "draft"   : "no",

     "title"   : "EDK II C Cod= ing Standards Specification",

-    "version" : "Revision 2.2"

+    "version" : "Revision 2.4"

   },

   "plugins": ["puml-aleung"],

   "pluginsConfig": {}

--
2.46.1



-=3D-=3D-=3D-=3D-=3D-=3D
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120616): https://edk2.groups.io/g/devel/message/120616
Mute This Topic: https:/= /groups.io/mt/108941574/1686594
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.= groups.io/g/devel/unsub [spbrogan@outlook.com]
-=3D-=3D-=3D-=3D-=3D-=3D


_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#120617) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_CH3P221MB1368AECCC8FE4995917369E8C8792CH3P221MB1368NAMP_--