From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0E9B32217CE58 for ; Sun, 7 Jan 2018 21:29:24 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jan 2018 21:34:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,329,1511856000"; d="scan'208";a="7957093" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga007.fm.intel.com with ESMTP; 07 Jan 2018 21:34:34 -0800 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 7 Jan 2018 21:34:34 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 7 Jan 2018 21:34:33 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.218]) with mapi id 14.03.0319.002; Mon, 8 Jan 2018 13:34:31 +0800 From: "Gao, Liming" To: M1cha , "edk2-devel@lists.01.org" CC: Ard Biesheuvel , "Kinney, Michael D" Thread-Topic: [edk2] [PATCH v3 3/3] MdePkg: add NORETURN attribute to LongJump and InternalLongJump Thread-Index: AQHTf0jzMNUZbVOEwUGKDWcqkidlD6NphLcw Date: Mon, 8 Jan 2018 05:34:31 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1A022D@SHSMSX104.ccr.corp.intel.com> References: <20171227192850.26774-1-sigmaepsilon92@gmail.com> <20171227192850.26774-2-sigmaepsilon92@gmail.com> In-Reply-To: <20171227192850.26774-2-sigmaepsilon92@gmail.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v3 3/3] MdePkg: add NORETURN attribute to LongJump and InternalLongJump X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jan 2018 05:29:25 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Michael: After more test, this patch will cause MdeModulePkg DxeCore link failure = on VS2015x86 tool chain. The warning message is caused by NORETURN attribut= e in LongJump() API. Is this patch really required? Could we separate it fr= om the change RETURNS_TWICE? If yes, I suggest to commit RETURNS_TWICE patc= h first, then work out the solution on NORETURN attribute enabling.=20 c:\edk2\mdemodulepkg\core\dxe\image\image.c(1863) : error C2220: warning tr= eated as error - no 'executable' file generated c:\edk2\mdemodulepkg\core\dxe\image\image.c(1863) : warning C4702: unreacha= ble code c:\edk2\mdemodulepkg\core\dxe\image\image.c(1864) : warning C4702: unreacha= ble code >-----Original Message----- >From: M1cha [mailto:sigmaepsilon92@gmail.com] >Sent: Thursday, December 28, 2017 3:29 AM >To: edk2-devel@lists.01.org >Cc: Ard Biesheuvel ; Kinney, Michael D >; Gao, Liming >Subject: [edk2] [PATCH v3 3/3] MdePkg: add NORETURN attribute to >LongJump and InternalLongJump > >This fixes compiler warnings when using them in functions which >should return a value but rely on LongJump to never return instead. > >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Michael Zimmermann >--- >V3: fix VS compilation errors > > MdePkg/Include/Library/BaseLib.h | 1 + > MdePkg/Library/BaseLib/BaseLibInternals.h | 1 + > MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c | 1 + > MdePkg/Library/BaseLib/Ia32/LongJump.c | 1 + > MdePkg/Library/BaseLib/LongJump.c | 1 + > 5 files changed, 5 insertions(+) > >diff --git a/MdePkg/Include/Library/BaseLib.h >b/MdePkg/Include/Library/BaseLib.h >index 10976032adaa..c6783f4624e2 100644 >--- a/MdePkg/Include/Library/BaseLib.h >+++ b/MdePkg/Include/Library/BaseLib.h >@@ -4927,6 +4927,7 @@ SetJump ( > restored and must be non-zero. > > **/ >+NORETURN > VOID > EFIAPI > LongJump ( >diff --git a/MdePkg/Library/BaseLib/BaseLibInternals.h >b/MdePkg/Library/BaseLib/BaseLibInternals.h >index 9dca97a0dcc9..5cc83d2956e5 100644 >--- a/MdePkg/Library/BaseLib/BaseLibInternals.h >+++ b/MdePkg/Library/BaseLib/BaseLibInternals.h >@@ -441,6 +441,7 @@ InternalAssertJumpBuffer ( > @param Value The value to return when the SetJump() context is >restored. > > **/ >+NORETURN > VOID > EFIAPI > InternalLongJump ( >diff --git a/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c >b/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c >index e309e8b57d7a..f48d7d17c4e4 100644 >--- a/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c >+++ b/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c >@@ -54,6 +54,7 @@ SetJump ( > @param Value The value to return when the SetJump() context is >restored. > > **/ >+NORETURN > VOID > EFIAPI > InternalLongJump ( >diff --git a/MdePkg/Library/BaseLib/Ia32/LongJump.c >b/MdePkg/Library/BaseLib/Ia32/LongJump.c >index 73973a9cceae..8fc86f9efb69 100644 >--- a/MdePkg/Library/BaseLib/Ia32/LongJump.c >+++ b/MdePkg/Library/BaseLib/Ia32/LongJump.c >@@ -28,6 +28,7 @@ > > **/ > __declspec (naked) >+NORETURN > VOID > EFIAPI > InternalLongJump ( >diff --git a/MdePkg/Library/BaseLib/LongJump.c >b/MdePkg/Library/BaseLib/LongJump.c >index 062be8f2daa1..fef764d6787e 100644 >--- a/MdePkg/Library/BaseLib/LongJump.c >+++ b/MdePkg/Library/BaseLib/LongJump.c >@@ -33,6 +33,7 @@ > restored and must be non-zero. > > **/ >+NORETURN > VOID > EFIAPI > LongJump ( >-- >2.15.1