浏览代码

add noreturn

Meco Man 4 年之前
父节点
当前提交
23d4c200c9
共有 2 个文件被更改,包括 6 次插入0 次删除
  1. 2 0
      components/libc/compilers/armlibc/stubs.c
  2. 4 0
      components/libc/compilers/newlib/syscalls.c

+ 2 - 0
components/libc/compilers/armlibc/stubs.c

@@ -270,6 +270,8 @@ RT_WEAK void _sys_exit(int return_code)
         rt_thread_suspend(self);
         rt_schedule();
     }
+
+    while(1); /* noreturn */
 }
 
 /**

+ 4 - 0
components/libc/compilers/newlib/syscalls.c

@@ -303,6 +303,8 @@ exit (int status)
         rt_thread_suspend(self);
         rt_schedule();
     }
+
+    while(1); /* noreturn */
 }
 
 void
@@ -334,6 +336,8 @@ void abort(void)
         rt_thread_suspend(self);
         rt_schedule();
     }
+
+    while(1); /* noreturn */
 }
 
 uid_t getuid(void)