Abner,
>From what I read, the idea of BZ1766 is to add recommendations to use static 
>for local symbols.

"Add recommendations to the EDK II C Coding Standards Specification to use
'static' for all functions and global variables that are not referenced
outside the current C file."

Do you want to capture that in the EDKII C Coding Standard?

Thanks,
Ray

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Chang,
> Abner via groups.io
> Sent: Tuesday, November 22, 2022 12:47 PM
> To: devel@edk2.groups.io
> Cc: Ni, Ray <ray...@intel.com>; Kinney, Michael D
> <michael.d.kin...@intel.com>
> Subject: [edk2-devel] [PATCH] edk II C Coding Standard: Remove section
> 5.4.2.2 STATIC
> 
> From: Abner Chang <abner.ch...@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.ch...@amd.com>
> Cc: Ray Ni <ray...@intel.com>
> Cc: Michael D Kinney <michael.d.kin...@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
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96531): https://edk2.groups.io/g/devel/message/96531
Mute This Topic: https://groups.io/mt/95190239/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to