2011-06-25 8 views
3

gccをデフォルト4.2.1から4.5にアップデートしました。しかし、ruby extconf.rbを実行すると、gccが認識しない警告フラグが生成されます。extconf.rbが特定の警告フラグを使用しない方法はありますか?

cc1: error: unrecognized command line option "-Wshorten-64-to-32" 

この警告フラグを使用しないことを伝えるためにextconf.rbはファイルを編集する方法はありますか、それを認識するためにはgccを取得する方法はありますか?それが役に立つならばここに私のgccのバージョンは次のとおりです。

$ gcc -v 
Using built-in specs. 
COLLECT_GCC=gcc 
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin10/4.5.3/lto-wrapper 
Target: x86_64-apple-darwin10 
Configured with: ../gcc-4.5.3/configure --prefix=/opt/local --build=x86_64-apple-darwin10 --enable-languages=c,c++,objc,obj-c++,fortran,java --libdir=/opt/local/lib/gcc45 --includedir=/opt/local/include/gcc45 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-4.5 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-4.5 --with-gxx-include-dir=/opt/local/include/gcc45/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --enable-stage1-checking --disable-multilib --enable-fully-dynamic-string 
Thread model: posix 
gcc version 4.5.3 (GCC) 

答えて

1

mkmfははCONFIGで定義された文字列のテーブルを使用してメイクファイル構成を生成し、警告フラグはCONFIG['warnflags']であるので、あなたは

CONFIG['warnflags'].slice!(/ -Wshorten-64-to-32/) 
ような何かを行うことができます

の前に、create_makefileが呼び出されて、特定の警告フラグが取り除かれます。

関連する問題