f-stack에서nginx 설정 후 오류 발생: ignoring return value of "ftruncate"

2057 단어

문제


Nginx 구성 후 오류 발생:
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는 만들 수 없습니다.
    원본 문서에 따라 configure를 구성합니다.
    # bash ./configure --prefix=/usr/local/nginx_fstack --with-ff_module
    
    # make
  • 다음 오류가 발생했습니다.
  • 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

    좋은 웹페이지 즐겨찾기