-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[libc] Remove unused _Thread_local define from headers. #156967
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
Conversation
It was added in dd33f9c to describe thread-local errno, but is no longer used in the codebase (with the exception of a single integration test, but the llvm-libc-provided `#define _Thread_local thread_local` is not needed there anyway, since `_Thread_local` is a keyword from C11 onwards.
@llvm/pr-subscribers-libc Author: Alexey Samsonov (vonosmas) ChangesIt was added in dd33f9c to describe thread-local errno, but is no longer used in the codebase (with the exception of a single integration test, but the llvm-libc-provided Full diff: https://github.com/llvm/llvm-project/pull/156967.diff 1 Files Affected:
diff --git a/libc/include/__llvm-libc-common.h b/libc/include/__llvm-libc-common.h
index 1fe3f4d2aea9c..70d8263e63b65 100644
--- a/libc/include/__llvm-libc-common.h
+++ b/libc/include/__llvm-libc-common.h
@@ -37,9 +37,6 @@
#undef _Alignof
#define _Alignof alignof
-#undef _Thread_local
-#define _Thread_local thread_local
-
#undef __NOEXCEPT
#if __cplusplus >= 201103L
#define __NOEXCEPT noexcept
|
I don't think we should remove this definition from our public header. This is an alternative form of |
I'd like to confirm what we actually want to provide. E.g. this change removed As for C, IIUC (per https://en.cppreference.com/w/c/keyword.html), |
C23 6.4.1 points out that |
There is no need for any spelling of the thread-local storage class in the public libc API right now. So it's correct to leave any related header support out for now. If we (re-)introduce a public ABI using a thread-local variable exposed in a public header, then we will address all the complexities of different C and C++ language versions and extensions and how best to declare these variables in public headers. |
Right, so if in C23 |
that is my understanding, yes. (since it's in 6.4 "lexical elements" rather than in the library.) |
It was added in dd33f9c to describe thread-local errno, but is no longer used in the codebase (with the exception of a single integration test, but the llvm-libc-provided
#define _Thread_local thread_local
is not needed there anyway, since_Thread_local
is a keyword from C11 onwards.