public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] edk II C Coding Standard: Remove section 5.4.2.2 STATIC
@ 2022-11-22  4:47 Chang, Abner
  2022-11-22  5:48 ` [edk2-devel] " Ni, Ray
  0 siblings, 1 reply; 10+ messages in thread
From: Chang, Abner @ 2022-11-22  4:47 UTC (permalink / raw)
  To: devel; +Cc: Ray Ni, Michael D Kinney

From: Abner Chang <abner.chang@amd.com>

BZ #1766

Remove the entire 5.4.2.2 section.
We are not allowed to use upper-case STATIC in the source file now.
Just follow C standard and use the lower-case 'static'.

Leave the macro "#deifne STATIC static" there without removing
it to keep the backward compatable.

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
---
 5_source_files/54_code_file_structure.md | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/5_source_files/54_code_file_structure.md b/5_source_files/54_code_file_structure.md
index 0c4d6a2..9acc620 100644
--- a/5_source_files/54_code_file_structure.md
+++ b/5_source_files/54_code_file_structure.md
@@ -267,19 +267,3 @@ specified in Section 5.4.1.3 "Compile-Time Names".
 Thus, while it might be legal C, do **not** declare external variables anywhere
 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.
-
-##### 5.4.2.2.1 Do not reuse an object or function identifier with static storage duration.
-
-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.
-- 
2.37.1.windows.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-12-12  5:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-22  4:47 [PATCH] edk II C Coding Standard: Remove section 5.4.2.2 STATIC Chang, Abner
2022-11-22  5:48 ` [edk2-devel] " Ni, Ray
2022-11-22  6:07   ` Chang, Abner
2022-11-22 16:31     ` Michael D Kinney
2022-11-22 22:12       ` Pedro Falcato
2022-11-22 22:39         ` Michael D Kinney
2022-11-26  7:44       ` Chang, Abner
2022-11-28  9:08       ` Ard Biesheuvel
2022-11-28 15:41         ` Michael D Kinney
2022-12-12  5:30           ` Chang, Abner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox