rryqszq4 / ngx-php

ngx-php - Embedded php7 or php8 scripting language for nginx module. Mainline development version of the ngx-php.
BSD 2-Clause "Simplified" License
582 stars 56 forks source link

Ubuntu 20.04 (php 8.1) compile error #138

Closed ghost closed 2 years ago

ghost commented 2 years ago

Ubuntu 20.04 64bit PHP 8.1 from PPA nginx-1.20.02 (1.18.0 the same error)

In file included from /usr/include/string.h:495, from /usr/include/php/20210902/main/php_config.h:2167, from /usr/include/php/20210902/main/php.h:30, from /root/ngx_http_php7_module/src/ngx_http_php_module.h:32, from /root/ngx_http_php7_module/src/ngx_http_php_util.c:29: In function ‘strncat’, inlined from ‘str_replace’ at /root/ngx_http_php7_module/src/ngx_http_php_util.c:69:5: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:136:10: error: ‘__builtin_strncat’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=] 136 | return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /root/ngx_http_php7_module/src/ngx_http_php_util.c: In function ‘str_replace’: /root/ngx_http_php7_module/src/ngx_http_php_util.c:69:5: note: length computed here 69 | strncat(result, replace, strlen(replace)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[1]: *** [objs/Makefile:1402: objs/addon/src/ngx_http_php_util.o] Error 1 make[1]: Leaving directory '/root/nginx-1.20.2' make: *** [Makefile:10: build] Error 2

ghost commented 2 years ago

Without optimisation --with-cc-opt="-O3" compile ok.

rryqszq4 commented 2 years ago

@sergiyshutov Thanks report.