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 307777803CC for ; Mon, 3 Feb 2025 18:17:14 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=4cOmcGsFqS4jhf140NiFXV9ft2ombuMpq+NoVeliHV4=; 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:Content-Transfer-Encoding; s=20240830; t=1738606633; v=1; x=1738865832; b=Hj7EnrreuJBkuFmkiLBz4k5lhVsJ23EB0iYPnJQqVhQk2sBx2FaIZPptjkNRG/pNtixkXW1O 4fFwTofX7DJ5+fd/Y4KsLdJLQUVb0BAJl9FTys35rJWLptAI2hKS76mqvWQZ89TJKOyweGGWLIG 1Rng3YnIk5r7h2PrjiTeZZo1LHvNqsQzR1WfE1hYxv22PHU81/I45hqYSvloMBglJ4xlk8H1uOr ZcM+jQxvrkzqBZI6+vYY9y/6LvzMsUxwasMK8C0hbB9W1k0udPi9ZDAxGMJSqsR011ozs1DbAE9 EVcscq4tyu9e5Cmrz64qJkI++nF6q3OecK0fe8qq3rKyA== X-Received: by 127.0.0.2 with SMTP id DVdqYY7687511x2HcCQs5iJK; Mon, 03 Feb 2025 10:17:12 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by mx.groups.io with SMTP id smtpd.web10.95373.1738606631630274155 for ; Mon, 03 Feb 2025 10:17:11 -0800 X-CSE-ConnectionGUID: r8HPm8VYTEuWzETLGbUB4A== X-CSE-MsgGUID: mrD/RjnCRFKVxDK+3R0pbw== X-IronPort-AV: E=McAfee;i="6700,10204,11335"; a="38990301" X-IronPort-AV: E=Sophos;i="6.13,256,1732608000"; d="scan'208";a="38990301" X-Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2025 10:17:06 -0800 X-CSE-ConnectionGUID: cy3P2a8WQZ+gJKFmQbCjWA== X-CSE-MsgGUID: b4XyLsOTR42QResWaXuioA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="115514774" X-Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orviesa005.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 03 Feb 2025 10:17:05 -0800 X-Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Mon, 3 Feb 2025 10:17:04 -0800 X-Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44 via Frontend Transport; Mon, 3 Feb 2025 10:17:04 -0800 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.47) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.44; Mon, 3 Feb 2025 10:17:04 -0800 X-Received: from CO1PR11MB4929.namprd11.prod.outlook.com (2603:10b6:303:6d::19) by PH7PR11MB8571.namprd11.prod.outlook.com (2603:10b6:510:2fd::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8398.25; Mon, 3 Feb 2025 18:17:02 +0000 X-Received: from CO1PR11MB4929.namprd11.prod.outlook.com ([fe80::a886:6510:729d:f9d0]) by CO1PR11MB4929.namprd11.prod.outlook.com ([fe80::a886:6510:729d:f9d0%3]) with mapi id 15.20.8398.021; Mon, 3 Feb 2025 18:17:02 +0000 From: "Michael D Kinney via groups.io" To: Rebecca Cran , "devel@edk2.groups.io" , Sean Brogan , "Oliver Smith-Denny" , Pedro Falcato CC: "Kinney, Michael D" Subject: Re: [edk2-devel] [PATCH edk2-CCodingStandardsSpecification v2 1/1] Prefer use of `static` C keyword over EDK2 type `STATIC` Thread-Topic: [PATCH edk2-CCodingStandardsSpecification v2 1/1] Prefer use of `static` C keyword over EDK2 type `STATIC` Thread-Index: AQHbdi54MJHAhHmeTEi9iuDZ6968d7M14cWw Date: Mon, 3 Feb 2025 18:17:02 +0000 Message-ID: References: <20250203112604.2331684-1-rebecca@bsdio.com> <20250203112604.2331684-2-rebecca@bsdio.com> In-Reply-To: <20250203112604.2331684-2-rebecca@bsdio.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO1PR11MB4929:EE_|PH7PR11MB8571:EE_ x-ms-office365-filtering-correlation-id: b5837693-cf69-4a64-76e4-08dd447ef4de x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: =?us-ascii?Q?xZFeWhik2AZYjCWs1J7uldqtDjMbnJE8/eyD9Oul2Vt1cb4hAuAZaqBqVQoh?= =?us-ascii?Q?ECv+DfxQXs3F4fb9PG5XJYEKAmfjAVRhE61E2+APRakrchEqzrWjIZ5XAW0f?= =?us-ascii?Q?grcHToqqh1/3POEkNhG57lyldyaTDxdeWxV2yYP2cqH/r/Utf1u4srwD57hY?= =?us-ascii?Q?FFYcAPWmUTpvGbYLyTKCfNJCjEEPHRHWU2F2E5xOtCkhqlHnJOvQ0yFdWE1z?= =?us-ascii?Q?0o3mNSWPGZTzj2g5nIOFwdmhJ6pF5G0GzdkWbJFwnuFbpUAh1Ji+vvA0A31e?= =?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PH0ssuMKC/aJmPy0MquuYnQBXo3V8CGT?= =?us-ascii?Q?nAUW0JvbIMtZc9JJND8H8VmQtUYs4Yp/u+1HXdobMeHHVDa6i/9VKfesTkg3?= =?us-ascii?Q?m4Qu6Z8O16Ae9bNOADSSTvsLtMmF+mDZgjb43dbODST/VXogqYqHrOpCitIQ?= =?us-ascii?Q?pgHJTr897e1vEf6vqG/JaP6NNGvuT1r+8IHyjv70U3ex/SiKAX+8hefTOXaC?= =?us-ascii?Q?Y2L3oyzPYulriKgAcgHhfMU9cSszAEs8O/FmGklgeVZwC7ZoWA=3D=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?0vzJXNnIpNB1w4lN3AzOPl71+b72sOjuVHBGCIGIX7stycjtPDiwfF4Awhwh?= =?us-ascii?Q?JYGRsNjH3/iKUfZOhjxpq/qdi8A4fju58K7Di2d55ouxiqOEa1Wh4viIqwHs?= =?us-ascii?Q?+cYMvOHT/SMrbxJe7wiiqlwkGMsJ6IK6jnnJvQjBOwHZ7LE9li0dlpucz/Ol?= =?us-ascii?Q?nNmaXKxN4vdq+6cISqOwSWyy/bRffP8X1SQALQzJJV1PQLUQVOzudz3hsX6G?= =?us-ascii?Q?jtwrgzZZ6nZJB5TbpHcLn8FYA4VTeL3+MZE9ZNSVazEPEetV0WzmDan8GGIL?= =?us-ascii?Q?u1cc/slUA7Z7qnZCrIVbmk0lFYWbuqzNxHUwOceWdx+bMSj4+FNEFpTek/iU?= =?us-ascii?Q?2N9Wk3bitZWc9anbCmQZyn1o8LpirZLREfJShhzZvoXUeeLN45HaJUuzuK/3?= =?us-ascii?Q?WjYgOMp79m9F/9FVkGKlwInjKRD0GTvD+lXI7viXWpawJCuQ2tehqVr8P1qA?= =?us-ascii?Q?f1uqbNJjQGgDt6aYpUxeqqFOdrj8ORDQynH5M12TN8pEQ0NUw1WRuB82pK6t?= =?us-ascii?Q?tLTcoKaQhHqkaocRXrdMrZYh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ascii?Q?UYS/tVOxzGgkFyREIRSYtJHNchbkO1hHheG8J2C1rbechYS+ytRHDrbQ1h99?= =?us-ascii?Q?9R0a82N9zPCTIIwWuktyGIU3xpJsUerGcSs3YKYxLhmv8I5Zwg1dxYzqtfbK?= =?us-ascii?Q?F9j2SqugtKu5oSOMeIB+cQDjCLtipjOa6S2vAdMcYlzOaQXbtDCvWiU6/rSL?= =?us-ascii?Q?EA=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4929.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b5837693-cf69-4a64-76e4-08dd447ef4de X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2025 18:17:02.1183 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tDwUSBLi127EJcT2DVVAB8rXW7VKpxjZOsy7gRxbtEJa6q3/Mtcjz1mvEXEP+5zSTm7ESqmg5JUyc8Dv9fsitiQJIP8XdKboi4yQVt5AV40= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB8571 X-OriginatorOrg: intel.com 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: Mon, 03 Feb 2025 10:17:12 -0800 Resent-From: michael.d.kinney@intel.com Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 1JhC2mrV9FUMX7DvZUc60caex7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240830 header.b=Hj7Enrre; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io Hi Rebecca, The content changes look good. 2 comments below. Mike > -----Original Message----- > From: Rebecca Cran > Sent: Monday, February 3, 2025 3:26 AM > To: devel@edk2.groups.io; Kinney, Michael D > ; Sean Brogan ; > Oliver Smith-Denny ; Pedro Falcato > > Cc: Rebecca Cran > Subject: [PATCH edk2-CCodingStandardsSpecification v2 1/1] Prefer use > of `static` C keyword over EDK2 type `STATIC` >=20 > 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`. > Following further discussion, it was decided to disallow static local > variables to prevent breakage when using GoogleTest. >=20 > Update the Coding Specification to match. While here, remove the > outdated section disallowing static functions since they're no longer > a problem. >=20 > Bump the revision to 2.4. >=20 Need to add: Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Rebecca Cran > --- > 5_source_files/54_code_file_structure.md | 9 ++------- > 5_source_files/56_declarations_and_types.md | 2 +- > README.md | 3 ++- > book.json | 2 +- > 4 files changed, 6 insertions(+), 10 deletions(-) >=20 > diff --git a/5_source_files/54_code_file_structure.md > b/5_source_files/54_code_file_structure.md > index 0c4d6a26820c..c286b273fe42 100644 > --- a/5_source_files/54_code_file_structure.md > +++ b/5_source_files/54_code_file_structure.md > @@ -269,7 +269,8 @@ other than at the top level of a file as specified > by this document. >=20 > #### 5.4.2.2 Static >=20 > -An object declared `STATIC` has either file or block scope. > +An object declared `static` has file scope. > +Objects may not be declared 'static' within functions. >=20 > ##### 5.4.2.2.1 Do not reuse an object or function identifier with > static storage duration. >=20 > @@ -277,9 +278,3 @@ Throughout the set of source files defined within > a single .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 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 > limitation, > -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/56_declarations_and_types.md > index ec1803d980e1..77e3ce99c457 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. >=20 > -#### 5.6.1.2 The use of int, unsigned, char, void, static, long is a > violation of the coding convention. > +#### 5.6.1.2 The use of int, unsigned, char, void, long is a > violation of the coding convention. >=20 > The corresponding EFI types must be used instead. >=20 > diff --git a/README.md b/README.md > index 77cfdc8906b1..a8da462c3c46 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 > function calls | | > | | > [#1656](https://bugzilla.tianocore.org/show_bug.cgi?id=3D1656) Update > all Wiki pages for the BSD+Patent license change with SPDX identifiers > | | > | | > [#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 EDK2 type 'STATIC' > |February 2025| > diff --git a/book.json b/book.json > index d112b26e3ebf..a46c487e1b5c 100644 > --- a/book.json > +++ b/book.json > @@ -2,7 +2,7 @@ > "variables" : { > "draft" : "yes", > "title" : "EDK II C Coding Standards Specification", > - "version" : "Revision 2.2" > + "version" : "Revision 2.4" Version is ignored when "draft" is "yes", so this change can be dropped. book.json should only be updated in a release branch to publish a new relea= se. > }, > "plugins": ["puml-aleung"], > "pluginsConfig": {} > -- > 2.48.1 -=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 (#121069): https://edk2.groups.io/g/devel/message/121069 Mute This Topic: https://groups.io/mt/110968939/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-