On 14 May 2018 at 22:32, Rodrigo V. G. <rodr...@gmail.com> wrote:
> In addition to the bug:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60932
> I wanted to add some comment:
>
> It would be very useful if the _Atomic keyword would be supported in C++.
> This way the <stdatomic.h> header could be included inconditionally in C++ 
> code.
> Even if it is not compatible with the C++ <atomic> header, it would be useful.
>
> Supporting the _Atomic keyword in C++ would benefit at least two cases:
>
> - When mixing C and C++ code for interoperability (using, in C++, some
> variables declared as _Atomic in a C header).
>
> - When developing operating systems or kernels in C++, in a
> freestanding environment (cross compiler), <atomic> is not available,

Why not? It's part of a freestanding C++ implementation.

> but <stdatomic.h> is.

How? It's not part of any C++ implementation at all, freestanding or not.

> So to correctly use things like __atomic_fetch_add in C++ in
> freestanding mode, this is the only way. Otherwise one cannot use
> atomics at all in these conditions.

Why can't you use __atomic_fetch_add directly?

Reply via email to