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 オプションにも追加しようとしましたが、役に立ちませんでした。設定から Wall を削除したくありません... 他に選択肢はありますか?

4

1 に答える 1

1

pthreads コードを別のファイルに分割してみてください。これにより、これらの警告をトリガーしているファイルを #include することを避けることができます...

于 2011-11-01T23:33:08.150 に答える