Sujet : Re: transpiling to low level C
De : chris.m.thomasson.1 (at) *nospam* gmail.com (Chris M. Thomasson)
Groupes : comp.lang.cDate : 15. Dec 2024, 05:39:39
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vjlmia$dese$1@dont-email.me>
References : 1
User-Agent : Mozilla Thunderbird
On 12/14/2024 7:05 PM, Thiago Adams wrote:
I am working on a C backend that generates simple C code.
You can test it here:
http://thradams.com/cake/playground.html
[...]
Wrt to C11, it is missing <stdatomic.h>:
________________________
#include <stdio.h>
#include <stdatomic.h>
struct ct_bar
{
int a;
int b;
atomic_int m_atomic;
};
struct ct_foo
{
char* a;
struct ct_bar bar;
};
int main()
{
struct ct_foo foo = { "Hello", { 1, 2, 0 } };
atomic_exchange(&foo.bar.m_atomic, 42);
printf("%s\n%d\n%d\n%d\n",
foo.a, foo.bar.a, foo.bar.b, foo.bar.m_atomic);
return 0;
}
________________________