public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: M1cha <sigmaepsilon92@gmail.com>
To: edk2-devel@lists.01.org
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Liming Gao <liming.gao@intel.com>
Subject: [PATCH v3 3/3] MdePkg: add NORETURN attribute to LongJump and InternalLongJump
Date: Wed, 27 Dec 2017 20:28:50 +0100	[thread overview]
Message-ID: <20171227192850.26774-2-sigmaepsilon92@gmail.com> (raw)
In-Reply-To: <20171227192850.26774-1-sigmaepsilon92@gmail.com>

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 <sigmaepsilon92@gmail.com>
---
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



  reply	other threads:[~2017-12-27 19:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-27 19:28 [PATCH v3 1/3] MdePkg: add RETURNS_TWICE attribute M1cha
2017-12-27 19:28 ` M1cha [this message]
2018-01-08  5:34   ` [PATCH v3 3/3] MdePkg: add NORETURN attribute to LongJump and InternalLongJump Gao, Liming
2018-01-08  6:22     ` Michael Zimmermann
2018-01-10  3:45       ` Gao, Liming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171227192850.26774-2-sigmaepsilon92@gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox