作者热门文章
- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我刚刚将 gcc 从默认的 4.2.1 更新到 4.5。但是当我运行 ruby extconf.rb 时,我创建了一个 gcc 无法识别的警告标志。
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)
最佳答案
mkmf 使用 CONFIG
中定义的字符串表生成 makefile 配置,警告标志位于 CONFIG['warnflags']
中,因此您可以执行类似
CONFIG['warnflags'].slice!(/ -Wshorten-64-to-32/)
在 create_makefile
被调用以去除特定警告标志之前。
关于c - 有没有办法让 extconf.rb 不使用某些警告标志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6478475/
我是一名优秀的程序员,十分优秀!