!72 为LOS_Panic等函数添加noreturn属性

Merge pull request !72 from Caoruihong/noreturn
This commit is contained in:
openharmony_ci 2021-04-17 09:24:12 +08:00 committed by Gitee
commit d11a206619
3 changed files with 15 additions and 3 deletions

View File

@ -82,7 +82,7 @@ extern VOID *HalTskStackInit(UINT32 taskID, UINT32 stackSize, VOID *topStack);
* <ul><li>los_hw.h: the header file that contains the API declaration.</li></ul>
* @see None.
*/
LITE_OS_SEC_TEXT_MINOR VOID HalSysExit(VOID);
LITE_OS_SEC_TEXT_MINOR VOID HalSysExit(VOID) NORETURN;
/* *
* @ingroup los_context

View File

@ -501,8 +501,8 @@ extern VOID LOS_Msleep(UINT32 mSecs);
* @see
*/
extern UINT32 LOS_Start(VOID);
extern VOID LOS_Reboot(VOID);
extern VOID LOS_Panic(const CHAR *fmt, ...);
extern VOID LOS_Reboot(VOID) NORETURN;
extern VOID LOS_Panic(const CHAR *fmt, ...) NORETURN;
/**

View File

@ -70,6 +70,10 @@ extern "C" {
#define CLZ __iar_builtin_CLZ
#endif
#ifndef NORETURN
#define NORETURN __attribute__ ((__noreturn__))
#endif
/* for ARM Compiler */
#elif defined(__CC_ARM)
@ -97,6 +101,10 @@ extern "C" {
#define CLZ __clz
#endif
#ifndef NORETURN
#define NORETURN __declspec(noreturn)
#endif
#pragma anon_unions
/* for GNU Compiler */
@ -126,6 +134,10 @@ extern "C" {
#define CLZ __builtin_clz
#endif
#ifndef NORETURN
#define NORETURN __attribute__ ((__noreturn__))
#endif
#else
#error Unknown compiler.
#endif