[cfe-commits] C11 <stdatomic.h>

Eli Friedman eli.friedman at gmail.com
Fri Sep 14 20:17:05 PDT 2012


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...


Please put the new warning in a separate commit.

It looks like standard requires that we expose functions named
atomic_thread_fence, atomic_signal_fence, atomic_flag_test_and_set,
atomic_flag_test_and_set_explicit, and atomic_flag_clear; your version
of stdatomic.h doesn't include declarations for these functions (which
is required by C11 7.1.4p1).

-Eli



More information about the cfe-commits mailing list