public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Rebecca Cran" <rebecca@bsdio.com>
To: Sean Brogan <spbrogan@outlook.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>,
	Michael Kinney <michael.d.kinney@intel.com>,
	Oliver Smith-Denny <osde@linux.microsoft.com>
Subject: Re: [edk2-devel] [edk2-CCodingStandardsSpecification PATCH 1/1] Prefer use of `static` C keyword over EDK2 type `STATIC`
Date: Fri, 11 Oct 2024 10:47:09 -0600	[thread overview]
Message-ID: <2b59d0dd-3426-4741-a2a9-18275dd613b5@bsdio.com> (raw)
In-Reply-To: <CH3P221MB1368AECCC8FE4995917369E8C8792@CH3P221MB1368.NAMP221.PROD.OUTLOOK.COM>

I don't know, but I saw a message from Mike recently saying that someone 
should use 'static' instead of 'STATIC' - so we need to make a clear 
decision one way or the other.


-- 
Rebecca


On 10/10/24 9:41 PM, Sean Brogan wrote:
> I think @Oliver Smith-Denny <mailto:osde@linux.microsoft.com> 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.com>
> *Sent:* Thursday, October 10, 2024 6:20:39 PM
> *To:* Michael Kinney <michael.d.kinney@intel.com>; 
> devel@edk2.groups.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                                   | 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_code_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 this 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 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 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 
> violation 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=425) [CCS] 
> clarify line breaking and indentation requirements for multi-line 
> function calls |            |
>
>  |          | 
> [#1656](https://bugzilla.tianocore.org/show_bug.cgi?id=1656) Update 
> all Wiki pages for the BSD+Patent license change with SPDX 
> identifiers        |            |
>
>  |          | 
> [#607](https://bugzilla.tianocore.org/show_bug.cgi?id=607) 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' |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
>
>
>
> -=-=-=-=-=-=
> 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]
> -=-=-=-=-=-=
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120618): https://edk2.groups.io/g/devel/message/120618
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]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-10-11 16:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-11  1:20 [edk2-devel] [edk2-CCodingStandardsSpecification PATCH 1/1] Prefer use of `static` C keyword over EDK2 type `STATIC` Rebecca Cran
2024-10-11  3:41 ` Sean
2024-10-11 16:47   ` Rebecca Cran [this message]
2024-10-14 15:22     ` Oliver Smith-Denny
2024-10-14 16:47       ` Rebecca Cran
2024-10-14 17:09         ` Oliver Smith-Denny
2024-10-15 21:12 ` Michael D Kinney
2024-10-21 14:49   ` Rebecca Cran
2024-10-21 15:46     ` Michael D Kinney
2024-10-21 19:42     ` Pedro Falcato
2024-10-21 20:05       ` Oliver Smith-Denny
2024-10-21 20:21         ` Pedro Falcato
2024-10-21 20:26           ` Oliver Smith-Denny
2024-10-21 20:35             ` Michael D Kinney
2024-10-21 20:37               ` Oliver Smith-Denny
2024-10-21 21:04                 ` Michael D Kinney
2024-10-21 21:11                   ` Pedro Falcato

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2b59d0dd-3426-4741-a2a9-18275dd613b5@bsdio.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox