[libc-commits] [libc] [libc] Mark all __llvm_libc_errno definitions as noexcept (PR #98762)

via libc-commits libc-commits at lists.llvm.org
Sat Jul 13 11:38:09 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Petr Hosek (petrhosek)

<details>
<summary>Changes</summary>

The definitions must match the previous declaration in errno.h.

---
Full diff: https://github.com/llvm/llvm-project/pull/98762.diff


1 Files Affected:

- (modified) libc/src/errno/libc_errno.cpp (+2-2) 


``````````diff
diff --git a/libc/src/errno/libc_errno.cpp b/libc/src/errno/libc_errno.cpp
index 7b28a62c786b..7a17a5a8217c 100644
--- a/libc/src/errno/libc_errno.cpp
+++ b/libc/src/errno/libc_errno.cpp
@@ -57,7 +57,7 @@ namespace {
 LIBC_THREAD_LOCAL int thread_errno;
 }
 
-extern "C" int *__llvm_libc_errno() { return &thread_errno; }
+extern "C" int *__llvm_libc_errno() noexcept { return &thread_errno; }
 
 void Errno::operator=(int a) { thread_errno = a; }
 Errno::operator int() { return thread_errno; }
@@ -68,7 +68,7 @@ namespace {
 int shared_errno;
 }
 
-extern "C" int *__llvm_libc_errno() { return &shared_errno; }
+extern "C" int *__llvm_libc_errno() noexcept { return &shared_errno; }
 
 void Errno::operator=(int a) { shared_errno = a; }
 Errno::operator int() { return shared_errno; }

``````````

</details>


https://github.com/llvm/llvm-project/pull/98762


More information about the libc-commits mailing list