From nobody Tue May 7 22:43:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+96631+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1669453415037983.1750943466504; Sat, 26 Nov 2022 01:03:35 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id fr7aYY1788612xsX5ucA0A7l; Sat, 26 Nov 2022 01:03:33 -0800 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.43]) by mx.groups.io with SMTP id smtpd.web10.66891.1669453412959441464 for ; Sat, 26 Nov 2022 01:03:33 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CdRk3s4yg/OkQNy8gh7ijiVdTucbxqI7iUkaNp/sSz8zXCyL8r/Y9CGDu4gEOiIYNpQwDcRR7JjZtA/em9n7TXkC28vlA+eBlMfBWEL9vYXOmZg3/Nup3lRRFBgvmGKL9algloOprUxVHM2RnGqfs2+/Ed5GTMPhIdeKBVqFqtHDTCxZL0N3NiBU5OSKAyNzorV3s7SAXAWjD/Rtper/jQyE1M8pflzLGlDfueqzGsypl8i/b41L1tIDepbo6K+a8+jsoKS36yuJBhmndZurJZsSrbOJC7N2zVyngyirLWn0NsR+EA4wUdoH83WgZmLO/xDkRxdj0W1cm7/Ki3n9Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=24b/WzfH1LLwoIttn2fl5qByJj6pbnSKN7rLqlOIjls=; b=P+25PIjwBfzryw/aejGfvamLIdSj+04d8y6ATMULsBj1rZgZ59Tb46a5YB56Z3jRYuZLHOx/dEoNjft27UgRxevxFmS74b6SGNTE1fEh+q7Nx7xnDfUAUtMgqLCLl/xEHWRxBE0CNgTqRR2dxPaQDUfbVuysYw7XRuZi+wk0bM9NDsUje/z/86fV7uqXpnQL9Df55wEr1jUX0HhNUJDbJJQVvSLk38fC9jW5PFAok6nwSrqQSzSypsS4ABriVa+Cv4qYJg9r/3bKzQDtakialcyzTz/2LJpcUE8VvpARIJGIsvjvHhsnsmQ2FYwY5sG1j85nFLjGFAaw3PO9h8f4PQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none X-Received: from DS7PR05CA0099.namprd05.prod.outlook.com (2603:10b6:8:56::20) by BN9PR12MB5366.namprd12.prod.outlook.com (2603:10b6:408:103::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.21; Sat, 26 Nov 2022 09:03:31 +0000 X-Received: from DM6NAM11FT106.eop-nam11.prod.protection.outlook.com (2603:10b6:8:56:cafe::5e) by DS7PR05CA0099.outlook.office365.com (2603:10b6:8:56::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.8 via Frontend Transport; Sat, 26 Nov 2022 09:03:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+96631+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT106.mail.protection.outlook.com (10.13.172.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5857.18 via Frontend Transport; Sat, 26 Nov 2022 09:03:30 +0000 X-Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Sat, 26 Nov 2022 03:03:13 -0600 From: "Chang, Abner via groups.io" To: CC: Ray Ni , Michael D Kinney Subject: [edk2-devel] [PATCH V2] edk II C Coding Standard: Remove section 5.4.2.2 STATIC Date: Sat, 26 Nov 2022 17:02:57 +0800 Message-ID: <20221126090257.1479-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT106:EE_|BN9PR12MB5366:EE_ X-MS-Office365-Filtering-Correlation-Id: eb9d1b00-5ce4-48ed-42e1-08dacf8d16f6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: X+i0NldzvoG4sZIztWS3ak6bZFdkplYozLs73bgtt3pft9KsGI7HI6bNDm5G6+meWlct+ouriSzi7ucEg2F6n3nOdJhM+lvESY+3OyiDQNmpYb9RlKqH0pzNnWdFZLFqPQgpOGmXjX5v69n8TuLh1lIdI+m5gPFPJUcwktUiw7I4dp8OwGwJqZuNFsorPYBAy0VvwL9zREa1ZXc2TpXD0Pi2mJHqEl5v8WOEnT7JU2ygMYflt6PosP5RQC0t8yRbpeaw8Xicj2kAI21Y71zFMXer/Ie5nxMSCh3yaqQb5CIfw67xuTm7UUkLBiM0bEkhFoJhXq4tV5Al7yMkVEFBBG/GNyI+rW4Fa+GzmDBlNUOlfL8ctejgmzFmpni5+J9R0AAeoR+RrAxuyhX3asmuZfvLViNnuHX7eF3Va3Nl/z+3BPV1TDpvNsD9EsBY7arISuISzSPN6Tt5lAkBs8phws0+Ny1w/IQhtMSQmQ6L3EhPKCbSEfjW9LMuYwUEkwC1LciYlZvZNyFIjaPQkXD4YLOHwcVew7dAqQKixvxu8NRE7CoF3YonIiUrfPeCUsXxh0NtOORK4Q0bq6xLTr0B/g8LDcs5vsUHfdz5V7RDxhtAgXr4RzKGLuxZLBhHJIWyQK11nSzcyGZGaFAmhLaufEPK9EAMgJA5D5/fEHrhaVcZvMdPHk7Rqb96xOF6mislmQimpg/DywwuUQ3ntgiDPeZip8GzTgdLN/S+ZfkFZXs= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Nov 2022 09:03:30.7047 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eb9d1b00-5ce4-48ed-42e1-08dacf8d16f6 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT106.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5366 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@amd.com X-Gm-Message-State: 17u89yd8uPQ7IlQRIKEcJu97x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1669453413; bh=kuqb3rrKZEs7U+kvHDJKteRMbY50xjbQHMcGemAWjPo=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=YjUiC+3CXjlVgq7au8N7ZIN3Xf76lPAOiDGfNJhW2yyQBy69OLX+eiZm6I6VjCyOtos DkqeNyelMksNin2gRKUFEvxg3ExScLexFuuV0ZKKfd7hNGs0Ksw7x8FuVmlnuQ5y49GmQ DTHhaIJg6jdEv06b6udjaqgankoAEVi9Gc0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1669453415796100003 Content-Type: text/plain; charset="utf-8" From: Abner Chang BZ #1766 Revise the sections that mention the usage of "static" and remove section 5.4.2.2.1 and 5.4.2.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 compatible. Signed-off-by: Abner Chang Cc: Ray Ni Cc: Michael D Kinney --- 5_source_files/54_code_file_structure.md | 19 ++++--------------- 5_source_files/56_declarations_and_types.md | 2 +- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/5_source_files/54_code_file_structure.md b/5_source_files/54_c= ode_file_structure.md index 0c4d6a2..6a9fcc7 100644 --- a/5_source_files/54_code_file_structure.md +++ b/5_source_files/54_code_file_structure.md @@ -267,19 +267,8 @@ specified in Section 5.4.1.3 "Compile-Time Names". Thus, while it might be legal C, do **not** declare external variables any= where other than at the top level of a file as specified by this document. =20 -#### 5.4.2.2 Static +#### 5.4.2.2 static =20 -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 n= ot -reuse an identifier with static storage duration. The compiler may not be -confused by this, but the user may confuse unrelated variables with the sa= me -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 limitat= ion, -it is strongly recommended that functions not be declared static. +Use static for the variables and functions those are non-public to other s= ource +files is encouraged. This reduces the chances of symbol redefined error du= ring +link process. \ No newline at end of file diff --git a/5_source_files/56_declarations_and_types.md b/5_source_files/5= 6_declarations_and_types.md index ec1803d..db98b95 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 viola= tion of the coding convention. +#### 5.6.1.2 The use of int, unsigned, char, void, long and the data types= those are defined in EFI Data Types is a violation of the coding conventio= n. =20 The corresponding EFI types must be used instead. =20 --=20 2.37.1.windows.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 (#96631): https://edk2.groups.io/g/devel/message/96631 Mute This Topic: https://groups.io/mt/95269399/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-