I am trying to use __atomic_load_n on a gcc atomic builtins page, compiling with
gcc -Wall -march=i686 -std=gnu99 ll.c -o ll
but he tells me that he cannot
warning: implicit declaration of function '__atomic_load_n'
I thought that it would be enough to provide gcc arch and march flags (and make sure by setting the flag std=gnu99 ), but to no avail. In fact, even if I test the common __GCC_VERSION__ or __GNUC__ , it does not seem to __GNUC__ ... but I have a pretty vanilla gcc installation that comes with Unbuntu.
I know that I am doing something stupid, but I cannot understand that. I have gcc (Ubuntu / Linaro 4.6.3-1ubuntu5) 4.6.3
The code looks like this: it is a function that is never called (yet), so the problem is at compile time.
type* func(type* p) { type* q = __atomic_load_n (p, __ATOMIC_SEQ_CST); }
source share