【发布时间】:2012-03-13 12:34:06
【问题描述】:
我正在编写一个可以大量使用__sync_fetch_and_add 的程序。不幸的是,我的 autoconf 脚本通过这个相当简单的测试来搜索它:
AC_CHECK_FUNCS([__sync_fetch_and_add])
产生这个错误:
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
这太烦人了,因为我想使用该功能,但是某些平台上的某些人告诉我它无法正确编译。我想要一个原型,但似乎没有。
谢谢。
【问题讨论】:
标签: gcc synchronization autoconf