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]

Re: [PATCH v8 6/8] nptl: Add abilist symbols for C11 threads



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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]