diff --git a/arch/arm/src/common/arm_pthread_exit.c b/arch/arm/src/common/arm_pthread_exit.c index ba7eb825d2..22e2fbdf25 100644 --- a/arch/arm/src/common/arm_pthread_exit.c +++ b/arch/arm/src/common/arm_pthread_exit.c @@ -57,6 +57,10 @@ void up_pthread_exit(pthread_exitroutine_t exit, FAR void *exit_value) /* Let sys_call2() do all of the work */ sys_call2(SYS_pthread_exit, (uintptr_t)exit, (uintptr_t)exit_value); + + /* Suppress "'noreturn' function does return" warning */ + + while (1); } #endif /* !CONFIG_BUILD_FLAT && __KERNEL__ && !CONFIG_DISABLE_PTHREAD */ diff --git a/arch/risc-v/src/common/riscv_pthread_exit.c b/arch/risc-v/src/common/riscv_pthread_exit.c index 39964ea1ff..84fd7e5c18 100644 --- a/arch/risc-v/src/common/riscv_pthread_exit.c +++ b/arch/risc-v/src/common/riscv_pthread_exit.c @@ -55,6 +55,10 @@ void up_pthread_exit(pthread_exitroutine_t exit, FAR void *exit_value) { sys_call2(SYS_pthread_exit, (uintptr_t)exit, (uintptr_t)exit_value); + + /* Suppress "'noreturn' function does return" warning */ + + while (1); } #endif /* !CONFIG_BUILD_FLAT && __KERNEL__ && !CONFIG_DISABLE_PTHREAD */ diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h index 82092f5614..3f96120996 100644 --- a/include/nuttx/arch.h +++ b/include/nuttx/arch.h @@ -614,7 +614,7 @@ void up_task_start(main_t taskentry, int argc, FAR char *argv[]) ****************************************************************************/ void up_pthread_start(pthread_trampoline_t startup, - pthread_startroutine_t entrypt, pthread_addr_t arg); + pthread_startroutine_t entrypt, pthread_addr_t arg) noreturn_function; /**************************************************************************** @@ -633,7 +633,7 @@ void up_pthread_start(pthread_trampoline_t startup, * None ****************************************************************************/ -void up_pthread_exit(pthread_exitroutine_t exit, FAR void *exit_value); +void up_pthread_exit(pthread_exitroutine_t exit, FAR void *exit_value) noreturn_function; #endif