From 56c2bc96a6e7609c2fbd2dcca954b8780f524154 Mon Sep 17 00:00:00 2001 From: Wayne Ren Date: Fri, 13 Apr 2018 14:32:26 +0800 Subject: [PATCH] kernel: add CODE_UNREACHABLE in _StackCheckHandler * _StackCheckHandler is FUNC_NORETURN * if _ARCH_EXCPET is redefined for specific arch and has function return in some cases, e.g., interrupt or exception, a compiler warning will come out * So add CODE_UNREACHABLE to guarantee it will not return Signed-off-by: Wayne Ren --- kernel/compiler_stack_protect.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/compiler_stack_protect.c b/kernel/compiler_stack_protect.c index 7ed30bb22b7..b7d12bb3ddf 100644 --- a/kernel/compiler_stack_protect.c +++ b/kernel/compiler_stack_protect.c @@ -36,6 +36,7 @@ void FUNC_NORETURN _StackCheckHandler(void) /* Stack canary error is a software fatal condition; treat it as such. */ _k_except_reason(_NANO_ERR_STACK_CHK_FAIL); + CODE_UNREACHABLE; } /* Global variable */