[GH-ISSUE #127] 最新版编译报错 #98

Closed
opened 2026-03-04 12:18:54 +03:00 by kerem · 1 comment
Owner

Originally created by @typ431127 on GitHub (Aug 10, 2023).
Original GitHub issue: https://github.com/ADD-SP/ngx_waf/issues/127

系统版本: CentOS Linux release 7.3.1611 (Core)
内核版本: 3.10.0-514.26.2.el7.x86_64
nginx版本: nginx-1.20.1
nginx_waf版本: current最新版 git拉取
编译参数:

./configure --prefix=/app/nginx-1.20.1 --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module --with-http_v2_module --with-openssl=/data/install/openssl-1.0.2l/ --with-cc-opt=-std=gnu99 --add-module=/usr/local/src/ngx_waf --with-debug

错误说明

make阶段报错

	/usr/local/src/ngx_waf/src/ngx_http_waf_module_check.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -std=gnu99 -fstack-protector-strong -Wno-sign-compare  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /data/install/openssl-1.0.2l//.openssl/include -I objs -I src/http -I src/http/modules -I src/http/v2 -I /usr/local/src/ngx_waf/inc -I /usr/local/src/ngx_waf/lib -I /usr/local/modsecurity/include -I /usr/local/src/ngx_waf/lib/uthash/include -I /usr/local/src/nginx-1.20.1/libsodium/include \
	-o objs/addon/src/ngx_http_waf_module_config.o \
	/usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c
In file included from /usr/local/src/ngx_waf/inc/ngx_http_waf_module_type.h:23:0,
                 from /usr/local/src/ngx_waf/inc/ngx_http_waf_module_config.h:22,
                 from /usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c:1:
/usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c: In function ‘ngx_http_waf_captcha_conf’:
/usr/local/src/ngx_waf/inc/ngx_http_waf_module_macro.h:359:33: error: the comparison will always evaluate as ‘false’ for the address of ‘sitekey’ will never be NULL [-Werror=address]
 #define ngx_is_null_str(s) ((s) == NULL || (s)->data == NULL || (s)->len == 0 || ((s)->data[0] == '\0' && (s)->len == 1))
                                 ^
/usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c:833:13: note: in expansion of macro ‘ngx_is_null_str’
         if (ngx_is_null_str(&sitekey)) {
             ^
cc1: all warnings being treated as errors
make[1]: *** [objs/addon/src/ngx_http_waf_module_config.o] Error 1
make[1]: Leaving directory `/usr/local/src/nginx-1.20.1'
make: *** [build] Error 2

Originally created by @typ431127 on GitHub (Aug 10, 2023). Original GitHub issue: https://github.com/ADD-SP/ngx_waf/issues/127 系统版本: CentOS Linux release 7.3.1611 (Core) 内核版本: 3.10.0-514.26.2.el7.x86_64 nginx版本: nginx-1.20.1 nginx_waf版本: current最新版 git拉取 编译参数: ```shell ./configure --prefix=/app/nginx-1.20.1 --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module --with-http_v2_module --with-openssl=/data/install/openssl-1.0.2l/ --with-cc-opt=-std=gnu99 --add-module=/usr/local/src/ngx_waf --with-debug ``` #### 错误说明 make阶段报错 ``` /usr/local/src/ngx_waf/src/ngx_http_waf_module_check.c cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -std=gnu99 -fstack-protector-strong -Wno-sign-compare -I src/core -I src/event -I src/event/modules -I src/os/unix -I /data/install/openssl-1.0.2l//.openssl/include -I objs -I src/http -I src/http/modules -I src/http/v2 -I /usr/local/src/ngx_waf/inc -I /usr/local/src/ngx_waf/lib -I /usr/local/modsecurity/include -I /usr/local/src/ngx_waf/lib/uthash/include -I /usr/local/src/nginx-1.20.1/libsodium/include \ -o objs/addon/src/ngx_http_waf_module_config.o \ /usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c In file included from /usr/local/src/ngx_waf/inc/ngx_http_waf_module_type.h:23:0, from /usr/local/src/ngx_waf/inc/ngx_http_waf_module_config.h:22, from /usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c:1: /usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c: In function ‘ngx_http_waf_captcha_conf’: /usr/local/src/ngx_waf/inc/ngx_http_waf_module_macro.h:359:33: error: the comparison will always evaluate as ‘false’ for the address of ‘sitekey’ will never be NULL [-Werror=address] #define ngx_is_null_str(s) ((s) == NULL || (s)->data == NULL || (s)->len == 0 || ((s)->data[0] == '\0' && (s)->len == 1)) ^ /usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c:833:13: note: in expansion of macro ‘ngx_is_null_str’ if (ngx_is_null_str(&sitekey)) { ^ cc1: all warnings being treated as errors make[1]: *** [objs/addon/src/ngx_http_waf_module_config.o] Error 1 make[1]: Leaving directory `/usr/local/src/nginx-1.20.1' make: *** [build] Error 2 ```
kerem 2026-03-04 12:18:54 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@ADD-SP commented on GitHub (Sep 7, 2023):

请尝试升级 gcc 版本。

<!-- gh-comment-id:1710277191 --> @ADD-SP commented on GitHub (Sep 7, 2023): 请尝试升级 gcc 版本。
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ngx_waf#98
No description provided.