all warnings being treated as errors,,error: format ‘%u’ expects argument of type ‘unsigned int’

在centos7 系统编译tengine 时报错:

src/http/ngx_http_upstream_check_module.c:1489:2: error: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘ngx_uint_t’ [-Werror=format=]
  count, ngx_http_upstream_check_shm_generation);
  ^
src/http/ngx_http_upstream_check_module.c:1489:2: error: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘ngx_uint_t’ [-Werror=format=]
src/http/ngx_http_upstream_check_module.c:1492:2: error: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ngx_uint_t’ [-Werror=format=]
  check_len += sprintf(check_status + check_len,"peers->peers.nelts = %d\n", peers->peers.nelts);
  ^
src/http/ngx_http_upstream_check_module.c:1520:3: error: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘ngx_uint_t’ [-Werror=format=]
   peer[i].conf->port);
   ^
src/http/ngx_http_upstream_check_module.c:1520:3: error: format ‘%u’ expects argument of type ‘unsigned int’, but argument 8 has type ‘ngx_uint_t’ [-Werror=format=]
src/http/ngx_http_upstream_check_module.c:1520:3: error: format ‘%u’ expects argument of type ‘unsigned int’, but argument 9 has type ‘ngx_uint_t’ [-Werror=format=]
src/http/ngx_http_upstream_check_module.c:1520:3: error: format ‘%u’ expects argument of type ‘unsigned int’, but argument 11 has type ‘ngx_uint_t’ [-Werror=format=]
cc1: all warnings being treated as errors

原因很明显,应该是没有添加编译参数,警告被当成了错误处理。

解决办法;

-Wformat=0 就没问题了。Wformat这个配置在Centos下默认是关闭的,所以一直没报错,如果编译的时候打开,也会提示一样的错误。

记录一下另外一个错误:

如果在linux下安装openssl,执行config和make之后,在执行make install时如果出现下面的错误

cms.pod around line 457: Expected text after =item, not a number 
cms.pod around line 461: Expected text after =item, not a number 
cms.pod around line 465: Expected text after =item, not a number 
cms.pod around line 470: Expected text after =item, not a number 
cms.pod around line 474: Expected text after =item, not a number 
POD document had syntax errors at /usr/bin/pod2man line 69. 

 

有人验证 安装perl 5.16 可以兼容,安排低版本perl 5.16可以解决问题。

解决:
则在root权限下,执行rm -f /usr/bin/pod2man  然后重新make install

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值