zoukankan      html  css  js  c++  java
  • 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

    • 感谢那位工程师的回复!!
  • 相关阅读:
    Qt开发的应用记录读取用户习惯设置的方法
    Windows软件Everything的配置
    C语言的类型大小
    Petalinux和Vivado的安装
    Linux下MiniGUI库的安装
    Linux下的screen和作业任务管理
    Linux下的upx命令学习
    Linux下的strip命令学习
    地址解析协议(ARP)
    IP 地址结构
  • 原文地址:https://www.cnblogs.com/vancasola/p/9335724.html
Copyright © 2011-2022 走看看