You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code gives a compilation error using cosmocc (GCC) 11.2.0, while the code compiles without any error using GCC/Clang.
hello.c: In function ‘main’:
hello.c:11:3: error: operand type ‘_Atomic atomic_ant *’ {aka ‘_Atomic ant *’} is incompatible with argument 1 of ‘__atomic_load_n’
11 | ant ant2 = atomic_load(&ant1);
| ^~~
#include <stdatomic.h>
typedef struct ant {
int b;
} ant;
typedef _Atomic(ant) atomic_ant;
int main(int argc, char *argv[]) {
atomic_ant ant1 = { .b = 5 };
ant ant2 = atomic_load(&ant1);
return 0;
}
The text was updated successfully, but these errors were encountered:
The following code gives a compilation error using cosmocc (GCC) 11.2.0, while the code compiles without any error using GCC/Clang.
The text was updated successfully, but these errors were encountered: