This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
On 07/12/2018 07:52 PM, Adhemerval Zanella wrote:
On 12/07/2018 13:46, Florian Weimer wrote:On 02/02/2018 06:04 PM, Adhemerval Zanella wrote:diff --git a/include/stdc-predef.h b/include/stdc-predef.h index c569759..c2ab78a 100644 --- a/include/stdc-predef.h +++ b/include/stdc-predef.h @@ -57,7 +57,4 @@ - 3 additional Zanabazar Square characters */ #define __STDC_ISO_10646__ 201706L -/* We do not support C11 <threads.h>. */ -#define __STDC_NO_THREADS__ 1Should we do this only if we know that the compiler has _Thread_local support (based on a GCC and __cplusplus version check)?It seems reasonable, since its a installed header. Do we need to check for __cplusplus too? Shouldn't __GNUC_PREREQ (4.9) be suffice?
I think we can use __thread instead of _Thread_local with even older compilers, and also factor in __cplusplus if it is recent enough (essentially 2011 and later) for the !__GNUC__ case.
Maybe it's sufficient to say #if !defined (__GNUC__) && !defined (__cpluscplus) \ && __cplusplus < 201103L) # define __STDC_NO_THREADS__ 1 #endifOn the other hand, maybe your original change is right because in C11, _Thread_local support is not optional. Implementations are required to recognize the keyword (and presumably ignore it) even if they define __STDC_NO_THREADS__. And our <threads.h> will generally work fine even if the compiler does not actually support _Thread_local. So I'd say go with your original change.
(But I do think you need to do something about thread_local in the C++ case, independently of this discussion.)
Thanks, Florian
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |