[libc-commits] [libc] b4e75e1 - [libc][nfc] Fix ucontext buildbot failure with noexcept (#192343) (#192601)
via libc-commits
libc-commits at lists.llvm.org
Fri Apr 17 00:00:19 PDT 2026
Author: Jeff Bailey
Date: 2026-04-17T07:00:14Z
New Revision: b4e75e158e460f66407bd5be7d13a38ff61d816a
URL: https://github.com/llvm/llvm-project/commit/b4e75e158e460f66407bd5be7d13a38ff61d816a
DIFF: https://github.com/llvm/llvm-project/commit/b4e75e158e460f66407bd5be7d13a38ff61d816a.diff
LOG: [libc][nfc] Fix ucontext buildbot failure with noexcept (#192343) (#192601)
Added noexcept to getcontext and setcontext declarations and definitions
to resolve missing attribute warning on aliases.
This fixes failures on builders using GCC like
libc-x86_64-debian-gcc-fullbuild-dbg.
Added:
Modified:
libc/src/ucontext/getcontext.h
libc/src/ucontext/setcontext.h
libc/src/ucontext/x86_64/getcontext.cpp
libc/src/ucontext/x86_64/setcontext.cpp
Removed:
################################################################################
diff --git a/libc/src/ucontext/getcontext.h b/libc/src/ucontext/getcontext.h
index 337e360f77d31..00efbe04717bd 100644
--- a/libc/src/ucontext/getcontext.h
+++ b/libc/src/ucontext/getcontext.h
@@ -14,7 +14,7 @@
namespace LIBC_NAMESPACE_DECL {
-int getcontext(ucontext_t *ucp);
+int getcontext(ucontext_t *ucp) noexcept;
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/ucontext/setcontext.h b/libc/src/ucontext/setcontext.h
index fc4cc5f74ee8f..86a25b3a41245 100644
--- a/libc/src/ucontext/setcontext.h
+++ b/libc/src/ucontext/setcontext.h
@@ -14,7 +14,7 @@
namespace LIBC_NAMESPACE_DECL {
-int setcontext(const ucontext_t *ucp);
+int setcontext(const ucontext_t *ucp) noexcept;
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/ucontext/x86_64/getcontext.cpp b/libc/src/ucontext/x86_64/getcontext.cpp
index 43f353b4556ca..26fce6447ffe8 100644
--- a/libc/src/ucontext/x86_64/getcontext.cpp
+++ b/libc/src/ucontext/x86_64/getcontext.cpp
@@ -19,7 +19,8 @@ namespace LIBC_NAMESPACE_DECL {
// We use naked because we need to capture the exact register state
// at the moment of the function call, avoiding any compiler prologue/epilogue.
-__attribute__((naked)) LLVM_LIBC_FUNCTION(int, getcontext, (ucontext_t * ucp)) {
+__attribute__((naked)) LLVM_LIBC_FUNCTION(int, getcontext,
+ (ucontext_t * ucp)) noexcept {
asm(R"(
# ucp is in rdi
diff --git a/libc/src/ucontext/x86_64/setcontext.cpp b/libc/src/ucontext/x86_64/setcontext.cpp
index 0fa7715ce0f65..408298bed3d35 100644
--- a/libc/src/ucontext/x86_64/setcontext.cpp
+++ b/libc/src/ucontext/x86_64/setcontext.cpp
@@ -18,7 +18,7 @@
namespace LIBC_NAMESPACE_DECL {
__attribute__((naked)) LLVM_LIBC_FUNCTION(int, setcontext,
- (const ucontext_t *ucp)) {
+ (const ucontext_t *ucp)) noexcept {
asm(R"(
# ucp is in rdi
More information about the libc-commits
mailing list