From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=eb8GmMlm; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.223.43, mailfrom: abner.chang@amd.com) 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=24b/WzfH1LLwoIttn2fl5qByJj6pbnSKN7rLqlOIjls=; b=eb8GmMlmcSg709zQRuRjNVIVVCmd+0PIN/1cGtRJv9tDyMwi8Nvtda3/iKJAzfz2HarPjMNBtUzHd10DLEmmyMMaYwSVbJJ2vR35kKKdINyGAZEHWdPpIhyN7q+zXPYtkt7blmXqOdxcisUPEuOnFSTsVgcJBvpz+/2YVKs5dKQ= 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 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 (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 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 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" To: CC: Ray Ni , Michael D Kinney Subject: [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> X-Mailer: git-send-email 2.37.1.windows.1 MIME-Version: 1.0 Return-Path: Abner.Chang@amd.com 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: BCL: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-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(376002)(136003)(346002)(396003)(39860400002)(451199015)(36840700001)(40470700004)(46966006)(82310400005)(7696005)(26005)(478600001)(54906003)(2616005)(316002)(6916009)(36756003)(8936002)(5660300002)(81166007)(40480700001)(1076003)(356005)(83380400001)(2906002)(36860700001)(70586007)(70206006)(47076005)(426003)(16526019)(336012)(186003)(2876002)(82740400003)(6666004)(40460700003)(86362001)(8676002)(41300700001)(4326008)(36900700001);DIR:OUT;SFP:1101; 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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain 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