【发布时间】:2015-01-09 18:52:29
【问题描述】:
我正在尝试从命令行编译 zlib,并且在使用 -Wall -Wextra -Wconversion 时收到此消息(完整的交叉编译脚本如下):
编译器错误报告对于 ./configure 来说太苛刻了(也许删除
-Werror)。
这是生成该行的配置测试:
cat > $test.c << EOF
int foo() { return 0; }
EOF
echo "Checking for obsessive-compulsive compiler options..." >> configure.log
if try $CC -c $CFLAGS $test.c; then
:
else
echo "Compiler error reporting is too harsh for $0 (perhaps remove -Werror)." | tee -a configure.log
leave 1
fi
我不清楚究竟是什么被认为过于苛刻(特别是因为-Werror 不存在)。我也不太明白测试中使用的示例程序在做什么,所以我不清楚判断编译器警告“太苛刻”的标准是什么。
zlib 抱怨什么太苛刻了?
#! /bin/sh
export PATH="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH"
export CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
export CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
export LD=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
export AR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar
export RANLIB=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib
export CFLAGS="-Wall -Wextra -Wconversion --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdks""
export CXXFLAGS="-Wall -Wextra -Wconversion --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk""
【问题讨论】:
-
请提供configure.log的内容。