[PATCH v8 6/8] nptl: Add abilist symbols for C11 threads
Adhemerval Zanella
adhemerval.zanella@linaro.org
Fri Jul 13 21:09:00 GMT 2018
On 13/07/2018 16:56, Florian Weimer wrote:
> * 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.
Fixed.
More information about the Libc-alpha
mailing list