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 D3AF1D80D4E for ; Mon, 3 Feb 2025 19:09:34 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=AKAoPXU6rCeCBN2dc4sGTDh/NY1Rs72PAlk5/jzjilQ=; 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=1738609774; v=1; x=1738868973; b=HUDxlM4Ed2IwjLaYiHf4xtIa3RftjA1L5WcMgOB0jGGosV4yjLL6aUtG2mDbI6bdWSh0G5LM 7Xx5iZtdqNic45UoJKLJCUVui/Obj8FsKCtRNW9GnVJ4QKSs+WAztO8EdKn1CczISlogfINmemp 01BvBssX3QJE9/MN7QJolr0Eb64BHyIULjMfUwOuSXgyNy4wzbp8vPFP6uGfhDGkl3ZJM/P5sry DCM5dkPkvfjEMvePBm9DBd8LqLPGViApB5jze+W4mO4gCeAB4JUdI5hvNhLSHokeRwA6cfkTS4v 9YRH4+QZLF61iOLAEWI9enUofNfizlFiKYq9hoPdMgKvA== X-Received: by 127.0.0.2 with SMTP id qOUvYY7687511xeyaF3mJ4p6; Mon, 03 Feb 2025 11:09:33 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by mx.groups.io with SMTP id smtpd.web11.96493.1738609772315782430 for ; Mon, 03 Feb 2025 11:09:32 -0800 X-CSE-ConnectionGUID: QHa4vGVLQI6Z6yBnomlBZA== X-CSE-MsgGUID: /j0OtjfeR/+DYkIuYRnTOg== X-IronPort-AV: E=McAfee;i="6700,10204,11335"; a="49723811" X-IronPort-AV: E=Sophos;i="6.13,256,1732608000"; d="scan'208";a="49723811" X-Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2025 11:09:31 -0800 X-CSE-ConnectionGUID: hfkUm7cJT8my+aJ+iFRpbQ== X-CSE-MsgGUID: l0ZpKqNHSXyqFC3ihQF/Hg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,256,1732608000"; d="scan'208";a="110142558" X-Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orviesa009.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 03 Feb 2025 11:09:32 -0800 X-Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) 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; Mon, 3 Feb 2025 11:09:31 -0800 X-Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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 11:09:31 -0800 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.176) by edgegateway.intel.com (134.134.137.103) 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 11:09:31 -0800 X-Received: from CO1PR11MB4929.namprd11.prod.outlook.com (2603:10b6:303:6d::19) by SJ2PR11MB8300.namprd11.prod.outlook.com (2603:10b6:a03:548::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8398.24; Mon, 3 Feb 2025 19:09:25 +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 19:09:25 +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 v3 1/1] Prefer use of `static` C keyword over EDK2 type `STATIC` Thread-Topic: [PATCH edk2-CCodingStandardsSpecification v3 1/1] Prefer use of `static` C keyword over EDK2 type `STATIC` Thread-Index: AQHbdmvmqrRM1CZ+wE6d/sJgxATZHbM18Vig Date: Mon, 3 Feb 2025 19:09:25 +0000 Message-ID: References: <20250203184548.2528198-1-rebecca@bsdio.com> <20250203184548.2528198-2-rebecca@bsdio.com> In-Reply-To: <20250203184548.2528198-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_|SJ2PR11MB8300:EE_ x-ms-office365-filtering-correlation-id: ab20dccb-d297-4131-3685-08dd44864660 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: =?us-ascii?Q?GeInpZsecDMwR6qWryzNDQ4ddIBa+INWZlvqupoU9GwCvmNe+82ta0mQrteC?= =?us-ascii?Q?BLETSZdvzr3BlHKVDmK5rluFpgH7OqU4yBxmcFSYjBkdE0Uq+pChInBmeMkq?= =?us-ascii?Q?JEBXwmpoHwdbd3ZqX0ybdFdjmSGbnVKDYAHQ/sXfCAkzGQeDEZQtky20COCU?= =?us-ascii?Q?OjlTxLnAM5QDTIw61Y9OCy5LIbzlIRorSFDrw9HPEVpDsyeUSpMa4V5Xzr24?= =?us-ascii?Q?A07JLxSKzKCac+x4FZIwrQ9u3P6/4Rm8x+mYuHAqlSqPjXDjeEAj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HK+7slq4JTz4NDVNKfF7sCYOPC1Ha/JbbioaZYT?= =?us-ascii?Q?JfoLHTrVa9GW4v2LbHO1VtK487rwyUDZfXmSZHXP/ZK5xXKlrFpiS57tJu7m?= =?us-ascii?Q?UVNU4i104tIVwe3OP5nPNTnrYy5G1cSI1Y568LoxxezlPWKvIO0Mk25IxNta?= =?us-ascii?Q?jAqPGFAvmtPllkh1/m07cJRqqgESEhgcPILtOxsHBYmSeCJ9kPh8fujTBDN9?= =?us-ascii?Q?qKBob7ZQFgCmS+/33SDSphtxbVoUTFZLKpqZsh09Dd0GmF9uYw=3D=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?wy/PNEx7+tEGZR1OhmHotOQT4qh4+3zcZerhiPeQE6oVCxC0fcKRZj6HSoMj?= =?us-ascii?Q?OjXTnqYUrMa5J2mjfhoQxhHqNPyrba41SppqMT14/hmrFUiJrENdA8DkxlL4?= =?us-ascii?Q?SEbyXLP4oEH8KVQLAMgO+ZtfCpi5e3bDiUywbwMlrFMUpV1q2ETA4PLijz+i?= =?us-ascii?Q?5Aa6S0HJuPJpjgQ1eU+D6by5LqMjengyw7Zdaxhki528CZpgcQr2+0mOGYwt?= =?us-ascii?Q?iLShmSNomZl5gCt6e93cvfDixtj4EkpoeOD3Ain45KNQ5syWF6Ti2cbGN/xf?= =?us-ascii?Q?uk8louWnYRPzMytpq3Wy6Q7ksHpg0kvgguXPoRofiaCxz+MDEjZFa/0JEAvX?= =?us-ascii?Q?jl8XqbVBDs+Q61vm69S881V2BiF98IrvdEnhMITvg095QYJ10kieoJkFyOfS?= =?us-ascii?Q?pWUFSHYm103XTaM+zB8qpO2dxcY/pC++BmTbFqaNR4uV+EEE3XZf1Td9LAPM?= =?us-ascii?Q?jAcU1sdBw1m+07xz7WcTOhsVTdplzn2w3cf9FO9azQLmKF1B/2s8wnb+giaQ?= =?us-ascii?Q?JIQ/oE6lTvmQU/qEEv2oAys6RKbjDdDH/tGKaQkE+L7YmbyS75NSYAgz0QT9?= =?us-ascii?Q?65D+U171xMudsF408MvRwtjOTOnfgOsXZR+neis2J8IJ5a0WbXJwmQRWhs9o?= =?us-ascii?Q?ldqalUhKpuF+5C5J7nx9gmZgLM8ekVFf9/tQ3r61KdPfl4VJOiCnC+P8cFIg?= =?us-ascii?Q?sUaLzPfYmd5Fnx0A2r11NyuISHLZYBlcM64TEq6jghMuvQ9c5rFPWMe1k+Kq?= =?us-ascii?Q?zg4VT2PKUgomS14Op9ziJe8zOakOWddX2GN1e7YsiHTN0o/K31HAKZsdL5OY?= =?us-ascii?Q?Om4p28aspPxOzRfeBikvS1lI4YOJh9fpvy+PDnVdMbzHKV4o01znWfHDp2L8?= =?us-ascii?Q?3sn8AGZUZ2rhRgnSeXVBZBFj11D23fYTwh6p+wm2lPyiKuwLqwzNYTRx3i4z?= =?us-ascii?Q?Tw8vOHBfkJN73lUNt39jKV1tguI651+eXENGdMaRWvZEKj3motRjAtgEASCi?= =?us-ascii?Q?HSJRN/qgyxBSM/rGslf75Z/fqArvs8feMCLD4G0oYNgT8Ir67aBbD7/fvlsn?= =?us-ascii?Q?FAdNt+iFaeLvCUCYL5+w444JMozBu2d17XbveY/qKOi45jOKF5N+rEnvulEc?= =?us-ascii?Q?hds5rfRtdQnLSof+0lBezOECmsedReNmp+blLXUpvGBNLfQ78453JENZWmPh?= =?us-ascii?Q?i1I46jxJZCM6+r5M+scGy0vltvcW9y4DR5/NmK4pPvGcmbgisKUdMBvNbbJe?= =?us-ascii?Q?Apc8PpkVjcHGMUxqSFuPF4VCa1pInLQNcFcKsLiMrU3uH96e+3Lsu2+bWVQZ?= =?us-ascii?Q?2/Dc37KCV1fbGCC1wq4D9J/UyUvNRo1tl7nttznLQ4qX1n72cWIF6BE37bYy?= =?us-ascii?Q?w90ujijw3+Ynp47O1YRhOa9317mWx8pXwI002qZXeDKpW7pN6ik8DiX1uUWT?= =?us-ascii?Q?HVUzVaYYV3BmwYrx6WMNQ8984ig6kQUaapXWqDcGxU583WrlG1EXEVXkdxky?= =?us-ascii?Q?rWCY3snJDKpM8sCcKMAs3gyfM9iCB0rMq1g4p/+xlBuiv90qDGC5ZSpphd58?= =?us-ascii?Q?mkWfRyWS0DOTT37ZtA1c7gKHxNhE8cWBf1LExzmRoofLAPPcqDkp/sm2EqQu?= =?us-ascii?Q?fQ=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: ab20dccb-d297-4131-3685-08dd44864660 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2025 19:09:25.3220 (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: a45asOOZBeZQ7ipULY8aagyxRF+jUwBWFSqKMu5AZzeviEPyWyq2eJCEWbhxUB0lsJQAraxYM+J+hoNkk7X2CmIHVtPUU/+hYvBkwUuFpw8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR11MB8300 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 11:09:32 -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: w9kXg8gOl0jw6e1OxDbeonGNx7686176AA= 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=HUDxlM4E; 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=pass (policy=none) header.from=groups.io Reviewed-by: Michael D Kinney > -----Original Message----- > From: Rebecca Cran > Sent: Monday, February 3, 2025 10:46 AM > To: devel@edk2.groups.io; Kinney, Michael D > ; Sean Brogan ; > Oliver Smith-Denny ; Pedro Falcato > > Cc: Rebecca Cran > Subject: [PATCH edk2-CCodingStandardsSpecification v3 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 > 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 ++- > 3 files changed, 5 insertions(+), 9 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| > -- > 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 (#121077): https://edk2.groups.io/g/devel/message/121077 Mute This Topic: https://groups.io/mt/110977230/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-