From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web10.10810.1682650028441397722 for ; Thu, 27 Apr 2023 19:47:08 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=nvEOgFlN; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: pen-chunx.lu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682650028; x=1714186028; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=9zvPauvQUR6KLW+Xi8gwFQg0wNZM80nxRL5ZcVTfJYY=; b=nvEOgFlNIrSWfsPn3nn7frkh47Z5v0jgfgH1/hlcqPkrhPaeiUM1xfRk TLOCJdwO7cYPQNeUG59IhoPRoSO8DQrjXK/bshd86YFo20VMQOtxmXuXL o6TsT/vLY4zxppO5wq6o39r6deYZZOUrxwo1KdvwkIJfqm9kggViRWpEp iTOk59TYUA2Kb6ICZozcRnEkvTzTWRtKaPrRBSP+7MGZ3hKb/+3pjFtX3 pwN5SpQXV0RkPgEnEIDZJvHWFa4lAtiTk6FE1bgszxK2ZXr0XRWLQZaIM TABIIyf5tUCsfaXsC9AzcstBPWvMGvPDDuAN/+CFckvx1cEMF4NNwrT9M g==; X-IronPort-AV: E=McAfee;i="6600,9927,10693"; a="347656431" X-IronPort-AV: E=Sophos;i="5.99,233,1677571200"; d="scan'208";a="347656431" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2023 19:46:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10693"; a="940905904" X-IronPort-AV: E=Sophos;i="5.99,233,1677571200"; d="scan'208";a="940905904" Received: from shserverbios518.ccr.corp.intel.com ([10.5.215.124]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2023 19:46:58 -0700 From: "JoeX Lu" To: devel@edk2.groups.io Cc: JoeX Lu , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [PATCH] Support GLOBAL_REMOVE_IF_UNREFERENCED in GCC5/11 Date: Fri, 28 Apr 2023 10:46:37 +0800 Message-Id: <20230428024637.34637-1-pen-chunx.lu@intel.com> X-Mailer: git-send-email 2.31.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit CC: Michael D Kinney CC: Liming Gao CC: Zhiguang Liu Signed-off-by: JoeX Lu --- MdePkg/Include/Base.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index 6597e441a6..951fce43ee 100644 --- a/MdePkg/Include/Base.h +++ b/MdePkg/Include/Base.h @@ -45,8 +45,12 @@ SPDX-License-Identifier: BSD-2-Clause-Patent /// to it after all compiler and linker optimizations have been performed. /// /// +#if defined (__GNUC__) +#define GLOBAL_REMOVE_IF_UNREFERENCED __attribute__((unused)) +#else #define GLOBAL_REMOVE_IF_UNREFERENCED #endif +#endif // // Should be used in combination with NORETURN to avoid 'noreturn' returns -- 2.31.1.windows.1