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 v2 3/3] MdePkg: add NORETURN attribute to LongJump and InternalLongJump
Date: Fri, 22 Dec 2017 20:14:16 +0100	[thread overview]
Message-ID: <20171222191416.5105-2-sigmaepsilon92@gmail.com> (raw)
In-Reply-To: <20171222191416.5105-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>
---
 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..e2eb46da4584 100644
--- a/MdePkg/Include/Library/BaseLib.h
+++ b/MdePkg/Include/Library/BaseLib.h
@@ -4929,6 +4929,7 @@ SetJump (
 **/
 VOID
 EFIAPI
+NORETURN
 LongJump (
   IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer,
   IN      UINTN                     Value
diff --git a/MdePkg/Library/BaseLib/BaseLibInternals.h b/MdePkg/Library/BaseLib/BaseLibInternals.h
index 9dca97a0dcc9..4486b15bd151 100644
--- a/MdePkg/Library/BaseLib/BaseLibInternals.h
+++ b/MdePkg/Library/BaseLib/BaseLibInternals.h
@@ -443,6 +443,7 @@ InternalAssertJumpBuffer (
 **/
 VOID
 EFIAPI
+NORETURN
 InternalLongJump (
   IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer,
   IN      UINTN                     Value
diff --git a/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c b/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c
index e309e8b57d7a..255464240ffa 100644
--- a/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c
+++ b/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c
@@ -56,6 +56,7 @@ SetJump (
 **/
 VOID
 EFIAPI
+NORETURN
 InternalLongJump (
   IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer,
   IN      UINTN                     Value
diff --git a/MdePkg/Library/BaseLib/Ia32/LongJump.c b/MdePkg/Library/BaseLib/Ia32/LongJump.c
index 73973a9cceae..d4b101fcb213 100644
--- a/MdePkg/Library/BaseLib/Ia32/LongJump.c
+++ b/MdePkg/Library/BaseLib/Ia32/LongJump.c
@@ -30,6 +30,7 @@
 __declspec (naked)
 VOID
 EFIAPI
+NORETURN
 InternalLongJump (
   IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer,
   IN      UINTN                     Value
diff --git a/MdePkg/Library/BaseLib/LongJump.c b/MdePkg/Library/BaseLib/LongJump.c
index 062be8f2daa1..7b91e076ba60 100644
--- a/MdePkg/Library/BaseLib/LongJump.c
+++ b/MdePkg/Library/BaseLib/LongJump.c
@@ -35,6 +35,7 @@
 **/
 VOID
 EFIAPI
+NORETURN
 LongJump (
   IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer,
   IN      UINTN                     Value
-- 
2.15.1



  reply	other threads:[~2017-12-22 19:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-22 19:14 [PATCH v2 2/3] MdePkg/BaseLib: add attribute 'RETURNS_TWICE' to SetJump M1cha
2017-12-22 19:14 ` M1cha [this message]
2018-01-02 12:31 ` 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=20171222191416.5105-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