On Sat, Sep 15, 2012 at 1:05 AM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Fri, Sep 14, 2012 at 8:17 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div>On Fri, Sep 14, 2012 at 7:48 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>> wrote:<br>
> Hi,<br>
><br>
> The attached patch adds an implementation of <stdatomic.h> to the set of<br>
> headers provided by Clang. Since this header is so compiler-dependent, it<br>
> seems that we are the most rational component to be providing this header<br>
> (even though, for instance, some flavors of BSD already provide their own).<br>
> Please review!<br>
<br>
</div></div>+// Clang allows memory_order_consume ordering for __c11_atomic_store,<br>
+// even though C11 doesn't allow it for atomic_store.<br>
<br>
That looks like a bug...<br></blockquote><div><br></div></div><div>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.</div>
</div></blockquote><div><br></div><div>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. :-)</div></div>