[libc-commits] [libc] e0b8f98 - Add some missing [[noreturn]] attributes
Noah Goldstein via libc-commits
libc-commits at lists.llvm.org
Mon May 22 13:54:32 PDT 2023
Author: Noah Goldstein
Date: 2023-05-22T15:54:19-05:00
New Revision: e0b8f98b1f488f56ff383de37edb97e1909acbbd
URL: https://github.com/llvm/llvm-project/commit/e0b8f98b1f488f56ff383de37edb97e1909acbbd
DIFF: https://github.com/llvm/llvm-project/commit/e0b8f98b1f488f56ff383de37edb97e1909acbbd.diff
LOG: Add some missing [[noreturn]] attributes
Missing in header for `pthread_exit` and `exit`.
Missing in spec file for `pthread_exit`.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D151143
Added:
Modified:
libc/spec/posix.td
libc/src/pthread/pthread_exit.h
libc/src/stdlib/exit.h
Removed:
################################################################################
diff --git a/libc/spec/posix.td b/libc/spec/posix.td
index b1aa2fb47212..ee17de8c170c 100644
--- a/libc/spec/posix.td
+++ b/libc/spec/posix.td
@@ -984,7 +984,7 @@ def POSIX : StandardSpec<"POSIX"> {
>,
FunctionSpec<
"pthread_exit",
- RetValSpec<VoidType>,
+ RetValSpec<NoReturn>,
[ArgSpec<VoidPtr>]
>,
FunctionSpec<
diff --git a/libc/src/pthread/pthread_exit.h b/libc/src/pthread/pthread_exit.h
index dd22c57cbecc..d8bdbb3f5bc6 100644
--- a/libc/src/pthread/pthread_exit.h
+++ b/libc/src/pthread/pthread_exit.h
@@ -13,7 +13,7 @@
namespace __llvm_libc {
-void pthread_exit(void *retval);
+[[noreturn]] void pthread_exit(void *retval);
} // namespace __llvm_libc
diff --git a/libc/src/stdlib/exit.h b/libc/src/stdlib/exit.h
index 7c015e3c0dae..fb3b20daf658 100644
--- a/libc/src/stdlib/exit.h
+++ b/libc/src/stdlib/exit.h
@@ -13,7 +13,7 @@
namespace __llvm_libc {
-void exit(int status);
+[[noreturn]] void exit(int status);
} // namespace __llvm_libc
More information about the libc-commits
mailing list