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

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


Author: Petr Hosek
Date: 2024-07-13T11:40:33-07:00
New Revision: b2468d7ec2ffddd212ec56b298dd9e45d60b062a

URL: https://github.com/llvm/llvm-project/commit/b2468d7ec2ffddd212ec56b298dd9e45d60b062a
DIFF: https://github.com/llvm/llvm-project/commit/b2468d7ec2ffddd212ec56b298dd9e45d60b062a.diff

LOG: [libc] Mark all __llvm_libc_errno definitions as noexcept (#98762)

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

Added: 
    

Modified: 
    libc/src/errno/libc_errno.cpp

Removed: 
    


################################################################################
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; }


        


More information about the libc-commits mailing list