Skip to content

Commit

Permalink
[libc] Mark all __llvm_libc_errno definitions as noexcept (llvm#98762)
Browse files Browse the repository at this point in the history
The definitions must match the previous declaration in errno.h.
  • Loading branch information
petrhosek authored Jul 13, 2024
1 parent 8802c9f commit b2468d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libc/src/errno/libc_errno.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand All @@ -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; }
Expand Down

0 comments on commit b2468d7

Please sign in to comment.