From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.67]) by mx.groups.io with SMTP id smtpd.web11.11695.1669092482783769830 for ; Mon, 21 Nov 2022 20:48:03 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=l2NPUYlO; 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.243.67, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FjozWaSFJMoCwSMuL9nyzoTbUTXkC2W7M480wWeDVzI9zMKaEy4B5reSa1RxkxxSJF8LukNTa/3jAUZPu0fjV/qPVdscJUsE6c3lqF8FzgjxN/XlWgUgKTgV3PYtPrDG7Yd7licjukFCR4A6oGk087z8+yddtPCZzS0x4QPZJn/NxAlGXhuehDRjYSf0x//mGd93mnCjcqAhN07n8RtFIBHVG0HbLk0nXwQNH7/CUpBbSt89791JueXXaPQ6Y5v/SldP13JflciruQ6F9X95ZJN98jDUkfWv7YFycTIjkDpJ6E9Q+Ho+kx4Qfdy7rGkymjkXcfP+HokUPw9uhHvGfw== 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=e9Ollg+xBnCWh5cfAk1uNJLzR1p0hgOQ3zloVK+DdKs=; b=d2nHKFYer7vufLtR2/uF3gLr0E/74xPf38in3rn1W35co5yglNChfEcWf4A1hSwrdgQBvFXLM9HmK4BrmOW2qc3zi2oBcnmxbzN/Ix3Mj4+5IuCRv1uamIqfooe4ATcaThi1ZcVmjTbDrG0e0yGvzdTzutIC3DEhvBm1ZVG6k7iKEnb5z2nNsXQgZNpamwcgRdUOIlWVglfKlvpfkF5ywuaXmYY9cn1X+Tpn+rSxjZC/ZSTs7kNI3s8CDj+DiLgBSfhIwvtdXn++XZLxJQW9wRdgXIX2JgjLYCZWFJGqHiGyPLUeNcqIYCKST/IVBWKHqc3jefgRYb8yvOma/emYVA== 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=e9Ollg+xBnCWh5cfAk1uNJLzR1p0hgOQ3zloVK+DdKs=; b=l2NPUYlO8mRfpSTqchjmHQhaHW6s+XfWd+VKE1PPjTIMcZOoOKVYAgUn3K+Fw91ILwGrxaLbIki6LSEtZbSkQ9kxOedZH6YzyjuTQbeUl0VnM2hwKAaHL1Ta09L3THcxA0U8FDhTpu6G4ReVm0rNt7te7sDcc5BqV2bzVh1T5bk= Received: from BN0PR02CA0007.namprd02.prod.outlook.com (2603:10b6:408:e4::12) by BL1PR12MB5779.namprd12.prod.outlook.com (2603:10b6:208:392::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.15; Tue, 22 Nov 2022 04:48:01 +0000 Received: from BN8NAM11FT097.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e4:cafe::1d) by BN0PR02CA0007.outlook.office365.com (2603:10b6:408:e4::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.15 via Frontend Transport; Tue, 22 Nov 2022 04:48:00 +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 BN8NAM11FT097.mail.protection.outlook.com (10.13.176.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5834.8 via Frontend Transport; Tue, 22 Nov 2022 04:48:00 +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; Mon, 21 Nov 2022 22:47:28 -0600 From: "Chang, Abner" To: CC: Ray Ni , Michael D Kinney Subject: [PATCH] edk II C Coding Standard: Remove section 5.4.2.2 STATIC Date: Tue, 22 Nov 2022 12:47:08 +0800 Message-ID: <20221122044708.672-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: BN8NAM11FT097:EE_|BL1PR12MB5779:EE_ X-MS-Office365-Filtering-Correlation-Id: e9676bea-199c-4733-3e98-08dacc44bbe8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KxJT4fZxwcQmJ267YNYqZ0ZpPkme8n2MieorU8BVysuhxfPdR6J9AXCYkB5tf8R7Fb1NB19/QjLUWdeeYMDFmmMraggJZ4SDyMnatv95PORg5Kd3Ejf3GsodMZoqvPfAjzDfLVrftSGp0J+1sMdTYRV55Bk6WV51pFlD/y2ZI1B0uGHkGlPg20pzcHmA0anfQcerOs9O8bpqR1Z1UHlBtBxn8YljTO8YSQOI9FHjhhuA8JgIZT032EwQI4+kue4UE1gda/J9G2QOAg9EOTO9P5ZTMQ/Iz3rGAHB2aumjgjUkArvVoCg5toN2tSSUQzj/8i0WYF2Ig9FfdyRXXbdkKWbiqd9fSKdsGiPT1pyGMFp65GSDRFHNsm9DQCZ8QAw11tmjxXBHePuJBHFpZ9t0kixZQ+Hp/BZHf69yaVo9SpDa/WiVRMzapZgVaJblj9LeCd1gFXsGNRs8Cx/Awtj1VARegBWSnuplv+wHULXLnH2RP0kr+bDmAkl+Nh6fx+GISt2lAukXi3X3PDRItV7p4HWxPxNHRgq6Q0Irhcw3Ou4jjgTJcuLZ4YDDt6aPt9a0j9ZjIwg6ZGifVSv9BUDHof+YgfvRYJUqybrSJFvj6C5Fnn1IHQ+zCvpc9eaYJSIv8jKhkuPfHNoNob6XxzTWvsky6eGiHxyuP8rZmgS95RROOUjYkXE5JEawZFTFNfiU9Oo6sVZgmwEMxrRGv7QUulmKMF1WMbffoklAazLwBag= 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)(39860400002)(136003)(376002)(346002)(396003)(451199015)(46966006)(36840700001)(40470700004)(36756003)(86362001)(7696005)(356005)(40460700003)(82740400003)(81166007)(82310400005)(8936002)(2906002)(336012)(83380400001)(36860700001)(40480700001)(41300700001)(2876002)(426003)(47076005)(6666004)(316002)(70586007)(16526019)(26005)(8676002)(5660300002)(2616005)(186003)(1076003)(478600001)(4326008)(54906003)(70206006)(6916009)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2022 04:48:00.8279 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e9676bea-199c-4733-3e98-08dacc44bbe8 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: BN8NAM11FT097.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5779 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Abner Chang 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 Cc: Ray Ni Cc: Michael D Kinney --- 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_c= ode_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 any= where other than at the top level of a file as specified by this document. =20 -#### 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 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. --=20 2.37.1.windows.1