I am writing a program that can use __ sync_fetch_and_add very heavily. Unfortunately, my autoconf script that searches for it with this rather simple test:
AC_CHECK_FUNCS([__sync_fetch_and_add])
Generates this error:
Wsuggest-attribute=noreturnconftest.c:56:1: warning: function declaration isn't a prototype [-Wstrict-prototypes] conftest.c:56:6: warning: conflicting types for built-in function '__sync_fetch_and_add' [enabled by default] conftest.c:65:1: warning: function declaration isn't a prototype [-Wstrict-prototypes] /tmp/ccqPsZz4.o: In function `main': /home/simsong/domex/src/bulk_extractor/tags/1.2.x/conftest.c:67: undefined reference to `__sync_fetch_and_add' collect2: ld returned 1 exit status
This is very annoying because I would like to use this feature, but some people on some platforms told me that it does not compile properly. I want a prototype, but it seems not one.
Thanks.
source share