0

使用 nvcc(使用 cuda 3.1)编译项目时,我从 gthr-default.h 收到大量警告:

/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/x86_64-redhat-linux/bits/gthr-default.h:118: warning: ‘int __gthrw_pthread_once(pthread_once_t*, void (*)())’ declared ‘static’ but never defined
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/x86_64-redhat-linux/bits/gthr-default.h:119: warning: ‘void* __gthrw_pthread_getspecific(pthread_key_t) throw ()’ declared ‘static’ but never defined
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/x86_64-redhat-linux/bits/gthr-default.h:120: warning: ‘int __gthrw_pthread_setspecific(pthread_key_t, const void*) throw ()’ declared ‘static’ but never defined

我已经到处挖了,似乎找不到抑制这种噪音的方法,除了移除-Wall,我真的不想这样做。这对任何人来说都很熟悉吗?

我的 CXXFLAGS 是:

CXXFLAGS=-Isrc -I../cxxtest -I$(CUDA_INCLUDE_DIR) -Xcompiler -O2 -Xcompiler -Wall

我也尝试将 $(CUDA_INCLUDE_DIR) 添加到 -Xcompiler 选项中,但无济于事。我不想从设置中删除墙...还有其他选项吗?

4

1 回答 1

1

尝试将您的 pthreads 代码分离到不同的文件中,这样您就可以避免 #include 触发这些警告的任何文件...

于 2011-11-01T23:33:08.150 回答