f-stack中nginx配置后make出现error: ignoring return value of ‘ftruncate’

问题

Nginx 配置后 make 出现error:

src/os/unix/ngx_process_cycle.c: In function ‘ngx_start_worker_processes’:
src/os/unix/ngx_process_cycle.c:388:5: error: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Werror=unused-result]
     (void) ftruncate(shm_fd, sizeof(sem_t));
     ^
cc1: all warnings being treated as errors
objs/Makefile:799: recipe for target 'objs/src/os/unix/ngx_process_cycle.o' failed
make[1]: *** [objs/src/os/unix/ngx_process_cycle.o] Error 1
make[1]: Leaving directory '/home/sdn/f-stack/app/nginx-1.11.10'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2

环境

  • The compiling environment is Ubuntu

  • uname -r:4.13.0-45-generic
  • cc -v:gcc version 5.4.0

DPDK和F-stack可以成功安装,但是Nginx无法make。

按照原文档的方式配置configure:

# bash ./configure --prefix=/usr/local/nginx_fstack --with-ff_module

# make
  • 出现以下error:
src/os/unix/ngx_process_cycle.c: In function ‘ngx_start_worker_processes’:
src/os/unix/ngx_process_cycle.c:388:5: error: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Werror=unused-result]
     (void) ftruncate(shm_fd, sizeof(sem_t));
     ^
cc1: all warnings being treated as errors
objs/Makefile:799: recipe for target 'objs/src/os/unix/ngx_process_cycle.o' failed
make[1]: *** [objs/src/os/unix/ngx_process_cycle.o] Error 1
make[1]: Leaving directory '/home/sdn/f-stack/app/nginx-1.11.10'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2

解决办法

在配置文件的时候,键入:

./configure --prefix=/usr/local/nginx_fstack --with-ff_module --with-cc-opt="-Wno-implicit-fallthrough -Wno-unused-result"

github issues

  • 感谢那位工程师的回复!!

转载于:https://www.cnblogs.com/vancasola/p/9335724.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值