Skip to content

[libc] Mark all __llvm_libc_errno definitions as noexcept #98762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 13, 2024

Conversation

petrhosek
Copy link
Member

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

The definitions must match the previous declaration in errno.h.
@petrhosek petrhosek added the libc label Jul 13, 2024
@petrhosek petrhosek requested review from jhuber6 and lntue July 13, 2024 18:37
@llvmbot
Copy link
Member

llvmbot commented Jul 13, 2024

@llvm/pr-subscribers-libc

Author: Petr Hosek (petrhosek)

Changes

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

Copy link
Contributor

@jhuber6 jhuber6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you local build not catch any of this?

@petrhosek
Copy link
Member Author

Did you local build not catch any of this?

Sadly no since I didn't try to build every mode which in hindsight was a mistake.

@petrhosek petrhosek merged commit b2468d7 into llvm:main Jul 13, 2024
6 of 7 checks passed
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
The definitions must match the previous declaration in errno.h.
akshaykumars614 pushed a commit to akshaykumars614/llvm-project that referenced this pull request Jul 15, 2024
The definitions must match the previous declaration in errno.h.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants