This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v8 6/8] nptl: Add abilist symbols for C11 threads
* Adhemerval Zanella:
>> I think ONCE_FLAG_INIT needs to be a compound literal, not an
>> initializer, at least that's how I read the standard (“which expands
>> to a value that can be used to initialize an object”).
>
> Right, you are correct, this will prevent ONCE_FLAG_INIT to be wrongly
> used to initialize other objects than once_flag. I adjust to be a
> struct as well.
Sorry, I forgot that this needs another __cplusplus conditional.
Something like this:
#ifdef __cplusplus
# define ONCE_FLAG_INIT (once_flag {})
#else
# define ONCE_FLAG_INIT (once_flag) { 0 }
#endif
Compound literals in C++ are a GCC extension.
>>> - thread_local guards for C++.
>>
>> Missing indentation of the #define. The manual could mention that
>> for C++, C++11 or later needs to be used to get the thread_local
>> keyword (not the macro).
>
> Ack and I added a note on manual about C++11 requirement.
Thanks.