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 C8124780091 for ; Fri, 11 Oct 2024 01:21:03 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=FKZtlzRHT0mfVAtSsUy12eVcT2tNaUtvTHtUO9l10pE=; c=relaxed/simple; d=groups.io; h=Feedback-ID:From:To:Cc:Subject:Date:Message-ID: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-Transfer-Encoding; s=20240830; t=1728609663; v=1; x=1728868862; b=KfJpAy/EtR/44CKBFoujfhkWqD3lzjasLgFxP1R7OaViIhpf36eYYemRLAtLUMDC7xYE4XVE 6M9QVnG/Mgs8HGknvkQNg5cIsGnT2diZuZRknO7DpSu44hO8JwfZDBvgVLYUktBHuB9zapkOVAv ghZqQpNVfHZSIlD3ISIBUbolb0SU5SUVTE5vsDU7F4vPenwhd9uwcFeEfYM9YjjN8WY2/J93JTZ frgp/rUA7V8ShrbzGCXpOLiybrH+ZrBpDHNtB8d9Tzz0dKIPfgpp01B558rX+6vJdgrcDvLOt2m boAxxXTv4mjyin63158FRVdk2Yly3hZOmivK/QaomywtA== X-Received: by 127.0.0.2 with SMTP id NVKYYY7687511x0xZ84iqLTP; Thu, 10 Oct 2024 18:21:02 -0700 X-Received: from fhigh-a5-smtp.messagingengine.com (fhigh-a5-smtp.messagingengine.com [103.168.172.156]) by mx.groups.io with SMTP id smtpd.web10.1418.1728609661707047360 for ; Thu, 10 Oct 2024 18:21:01 -0700 X-Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfhigh.phl.internal (Postfix) with ESMTP id C50B811401A9; Thu, 10 Oct 2024 21:21:00 -0400 (EDT) X-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Thu, 10 Oct 2024 21:21:00 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdefjedggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgggfestdhqredtredttdenucfh rhhomheptfgvsggvtggtrgcuvehrrghnuceorhgvsggvtggtrgessghsughiohdrtghomh eqnecuggftrfgrthhtvghrnheptdeftddvieevjeeigfehfedtvdellefhjeekfeegieev gfeiheeiueetkedvvdeknecuffhomhgrihhnpehtihgrnhhotghorhgvrdhorhhgnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprhgvsggvtggt rgessghsughiohdrtghomhdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouh htpdhrtghpthhtohepmhhitghhrggvlhdrugdrkhhinhhnvgihsehinhhtvghlrdgtohhm pdhrtghpthhtohepuggvvhgvlhesvggukhdvrdhgrhhouhhpshdrihhopdhrtghpthhtoh eprhgvsggvtggtrgessghsughiohdrtghomh X-ME-Proxy: Feedback-ID: i5b994698:Fastmail X-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 10 Oct 2024 21:20:59 -0400 (EDT) From: "Rebecca Cran" 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` Date: Thu, 10 Oct 2024 19:20:39 -0600 Message-ID: <20241011012040.274642-1-rebecca@bsdio.com> MIME-Version: 1.0 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 18:21:02 -0700 Resent-From: rebecca@bsdio.com Reply-To: devel@edk2.groups.io,rebecca@bsdio.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: AFm4daBtK9kLhAjiVNZBWjJ6x7686176AA= 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="KfJpAy/E"; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io 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. =0D #### 5.4.2.2 Static=0D =0D -An object declared `STATIC` has either file or block scope.=0D +An object declared `static` has either file or block scope.=0D =0D ##### 5.4.2.2.1 Do not reuse an object or function identifier with static = storage duration.=0D =0D @@ -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= =0D confused by this, but the user may confuse unrelated variables with the sa= me=0D name.=0D -=0D -##### 5.4.2.2.2 Functions should not be declared STATIC.=0D -=0D -Some source-level debuggers are unable to resolve static functions. Until = it=0D -can be verified that no one is dependent upon a debugger with this limitat= ion,=0D -it is strongly recommended that functions not be declared static.=0D 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=0D or from common EFI data types.=0D =0D -#### 5.6.1.2 The use of int, unsigned, char, void, static, long is a viola= tion of the coding convention.=0D +#### 5.6.1.2 The use of int, unsigned, char, void, long is a violation of = the coding convention.=0D =0D The corresponding EFI types must be used instead.=0D =0D 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 | |=0D | | [#1656](https://bugzilla.tianocore.org/show_bug.cgi?id=3D1656= ) Update all Wiki pages for the BSD+Patent license change with SPDX identif= iers | |=0D | | [#607](https://bugzilla.tianocore.org/show_bug.cgi?id=3D607) = Document code comment requirements for spurious variable assignments = | |=0D -| 2.3 | Add 4.2 Directory names section and update File names section= for the guidelines of module directory and file naming|September 2022||=0D +| 2.3 | Add 4.2 Directory names section and update File names section= for the guidelines of module directory and file naming = |September 2022|=0D +| 2.4 | The use of the 'static' C keyword is now preferred over the E= DK2 type 'STATIC' = |October 2024|=0D diff --git a/book.json b/book.json index d112b26..3ec7a93 100644 --- a/book.json +++ b/book.json @@ -1,8 +1,8 @@ {=0D "variables" : {=0D - "draft" : "yes",=0D + "draft" : "no",=0D "title" : "EDK II C Coding Standards Specification",=0D - "version" : "Revision 2.2"=0D + "version" : "Revision 2.4"=0D },=0D "plugins": ["puml-aleung"],=0D "pluginsConfig": {}=0D --=20 2.46.1 -=-=-=-=-=-=-=-=-=-=-=- 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/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-