From 19b0fc0a6b66f83154047a8ac43e66086e63610e Mon Sep 17 00:00:00 2001 From: Alex James Date: Mon, 17 Dec 2018 20:25:13 -0800 Subject: StdLib/Environs: Avoid infinite recursion in _Exit Use __builtin_unreachable instead of infinite recursion to fix an infinite recursion error when building StdLib with XCODE5/CLANG38. Cc: Daryl McDaniel Cc: Jaben Carsey Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Alex James Reviewed-by: Jaben Carsey --- StdLib/LibC/StdLib/Environs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/StdLib/LibC/StdLib/Environs.c b/StdLib/LibC/StdLib/Environs.c index 15221a1260..a29cb9954c 100644 --- a/StdLib/LibC/StdLib/Environs.c +++ b/StdLib/LibC/StdLib/Environs.c @@ -120,7 +120,7 @@ _Exit(int status) longjmp(gMD->MainExit, 0x55); // Get out of here. longjmp can't return 0. Use 0x55 for a non-zero value. #ifdef __GNUC__ - _Exit(status); /* Keep GCC happy - never reached */ + __builtin_unreachable (); // Keep GCC happy #endif } -- cgit v1.2.3