[cfe-commits] C11 <stdatomic.h>

Richard Smith richard at metafoo.co.uk
Mon Sep 17 13:32:29 PDT 2012


On Sat, Sep 15, 2012 at 1:05 AM, Richard Smith <richard at metafoo.co.uk>wrote:

> On Fri, Sep 14, 2012 at 8:17 PM, Eli Friedman <eli.friedman at gmail.com>wrote:
>
>> On Fri, Sep 14, 2012 at 7:48 PM, Richard Smith <richard at metafoo.co.uk>
>> wrote:
>> > Hi,
>> >
>> > The attached patch adds an implementation of <stdatomic.h> to the set of
>> > headers provided by Clang. Since this header is so compiler-dependent,
>> it
>> > seems that we are the most rational component to be providing this
>> header
>> > (even though, for instance, some flavors of BSD already provide their
>> own).
>> > Please review!
>>
>> +// Clang allows memory_order_consume ordering for __c11_atomic_store,
>> +// even though C11 doesn't allow it for atomic_store.
>>
>> That looks like a bug...
>>
>
> Possibly it's a bug in the specification for atomic_flag_clear?
> memory_order_consume doesn't seem to have any meaning for a store operation.
>

Yep, seems this is a defect in both C11 and C++11. In C++11, this is LWG
issue 2138. There's no corresponding issue for C11 yet, but Top Men are on
the case. :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120917/98d2e513/attachment.html>


More information about the cfe-commits mailing list