]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: avoid __builtin_unreachable() on GCC v4.4
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 14 Jul 2016 12:10:14 +0000 (14:10 +0200)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 21 Jul 2016 11:32:09 +0000 (13:32 +0200)
GCC v4.4 does not implement __builtin_unreachable(), so avoid using
it when building with this version or earlier.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-By: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Include/Base.h

index 858385828d933ff999677e83362f0b06493d15c1..7dbf9386b6b47e6f43630a811ded4483a7d76dba 100644 (file)
@@ -89,10 +89,11 @@ VERIFY_SIZE_OF (CHAR16, 2);
 // warnings.\r
 //\r
 #ifndef UNREACHABLE\r
-  #ifdef __GNUC__\r
+  #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)\r
     ///\r
     /// Signal compilers and analyzers that this call is not reachable.  It is\r
     /// up to the compiler to remove any code past that point.\r
+    /// Not implemented by GCC 4.4 or earlier.\r
     ///\r
     #define UNREACHABLE()  __builtin_unreachable ()\r
   #elif defined (__has_feature)\r