GCC警告提示错误“cc1:all warnings being treated as errors”

Ubuntu-12.04-i386编译Busybox-1.4.1时,出现一些警告并报错退出编译,这是由于设置了警告提示,cc1:all warnings being treated as errors

可修改Makefile的CFLAGS 或者CPPFLAGS参数,添加类似 -Wno-unused-but-set-variable这样的选项。

 编译过程中遇到的警告错误如下所述。

1、unused-but-set-variable

修改Makefile,设置参数CFLAGS += $(call cc-option,-Wno-unused-but-set-variable ,)


2、unused-result

修改Makefile,设置参数:CFLAGS += $(call cc-option,-Wno-unused-result ,)

 

3、format-security

修改Makefile,设置参数:CFLAGS += $(call cc-option,-Wno-format-security ,)

 

4、链接脚本错误

 修改scripts/trylink文件,try函数定义格式

GCC警告提示错误“cc1:all warnings being treated as errors”_第1张图片

你可能感兴趣的:(GCC警告提示错误“cc1:all warnings being treated as errors”)