]> git.proxmox.com Git - mirror_edk2.git/commit - MdePkg/Include/Base.h
MdePkg: Add NORETURN attribute and UNREACHABLE() macro.
authorMarvin H?user <Marvin.Haeuser@outlook.com>
Sun, 19 Jun 2016 01:28:51 +0000 (09:28 +0800)
committerLiming Gao <liming.gao@intel.com>
Wed, 22 Jun 2016 01:37:01 +0000 (09:37 +0800)
commit001f28caefbb2b5b05435adf36fc4e695b7b0f66
treedcebbea1a161f80c422aee1b97ada99e23992720
parent359cb1a3b91fe6a31213fc213ee7d630a40f399b
MdePkg: Add NORETURN attribute and UNREACHABLE() macro.

The NORETURN attribute informs compilers and analyzers that the flagged
function cannot return. This may improve the quality of the optimizations.

The UNREACHABLE() macro informs compilers and analyzers that its position
cannot be reached, for example eliminating implicit returns.
It is recommended to be used together with the NORETURN attribute to prevent
warnings regarding the function flagged as 'noreturn' returning.

The ANALYZER-prefixed versions have the same effects, but exclude compilers.
They may be used to surpress warnings of static analyzers, such as possible
dereferencing of a NULL pointer when dereferencing it after having checked it
via ASSERT().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
MdePkg/Include/Base.h