mirror of
https://github.com/ADD-SP/ngx_waf.git
synced 2026-04-26 22:15:55 +03:00
[GH-ISSUE #20] build failed on CentOS 7 #8
Labels
No labels
MacOS
Nginx
OpenResty
Tengine
bug
documentation
enhancement
needs-investigation
pull-request
question
stale
stale
stale
timeout
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ngx_waf#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @purplegrape on GitHub (Jan 18, 2021).
Original GitHub issue: https://github.com/ADD-SP/ngx_waf/issues/20
CentOS 7 x64
gcc 4.8.5
nginx 1.18.0
ngx_waf-3.1.0
Configuration summary
nginx path prefix: "/etc/nginx"
nginx binary file: "/usr/sbin/nginx"
nginx modules path: "/usr/lib64/nginx/modules"
nginx configuration prefix: "/etc/nginx"
nginx configuration file: "/etc/nginx/nginx.conf"
nginx pid file: "/var/run/nginx.pid"
nginx error log file: "/var/log/nginx/error.log"
nginx http access log file: "/var/log/nginx/access.log"
nginx http client request body temporary files: "/var/cache/nginx/client_temp"
nginx http proxy temporary files: "/var/cache/nginx/proxy_temp"
nginx http fastcgi temporary files: "/var/cache/nginx/fastcgi_temp"
nginx http uwsgi temporary files: "/var/cache/nginx/uwsgi_temp"
nginx http scgi temporary files: "/var/cache/nginx/scgi_temp"
make -f objs/Makefile modules
make[1]: Entering directory
/home/mock/rpmbuild/BUILD/nginx-module-http-waf-1.18.0' cc -c -fPIC -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -I src/core -I src/event -I src/event/modules -I src/os/unix -I ngx_waf-3.1.0/inc -I objs -I src/http -I src/http/modules -I src/http/v2 -I src/mail -I src/stream \ -o objs/addon/src/ngx_http_waf_module_core.o \ ngx_waf-3.1.0/src/ngx_http_waf_module_core.c In file included from ngx_waf-3.1.0/inc/ngx_http_waf_module_check.h:15:0, from ngx_waf-3.1.0/inc/ngx_http_waf_module_core.h:17, from ngx_waf-3.1.0/src/ngx_http_waf_module_core.c:1: ngx_waf-3.1.0/inc/ngx_http_waf_module_util.h: In function 'parse_ipv4': ngx_waf-3.1.0/inc/ngx_http_waf_module_util.h:126:5: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < 4; i++) { ^ ngx_waf-3.1.0/inc/ngx_http_waf_module_util.h:126:5: note: use option -std=c99 or -std=gnu99 to compile your code ngx_waf-3.1.0/inc/ngx_http_waf_module_util.h:133:13: error: 'for' loop initial declarations are only allowed in C99 mode for (uint32_t j = 0; j < suffix; j++) { ^ ngx_waf-3.1.0/inc/ngx_http_waf_module_util.h:142:14: error: redefinition of 'i' for (int i = 0; i < 4; i++) { ^ ngx_waf-3.1.0/inc/ngx_http_waf_module_util.h:126:14: note: previous definition of 'i' was here for (int i = 0; i < 4; i++) { ^ ngx_waf-3.1.0/inc/ngx_http_waf_module_util.h:142:5: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < 4; i++) { ^ ngx_waf-3.1.0/inc/ngx_http_waf_module_util.h: In function 'parse_ipv6': ngx_waf-3.1.0/inc/ngx_http_waf_module_util.h:207:5: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < 16; i++) { ^ ngx_waf-3.1.0/inc/ngx_http_waf_module_util.h:214:13: error: 'for' loop initial declarations are only allowed in C99 mode for (uint32_t j = 0; j < temp_suffix; j++) { ^ ngx_waf-3.1.0/inc/ngx_http_waf_module_util.h:222:14: error: redefinition of 'i' for (int i = 0; i < 16; i++) { ^ ngx_waf-3.1.0/inc/ngx_http_waf_module_util.h:207:14: note: previous definition of 'i' was here for (int i = 0; i < 16; i++) { ^ ngx_waf-3.1.0/inc/ngx_http_waf_module_util.h:222:5: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < 16; i++) { ^ In file included from ngx_waf-3.1.0/inc/ngx_http_waf_module_core.h:17:0, from ngx_waf-3.1.0/src/ngx_http_waf_module_core.c:1: ngx_waf-3.1.0/inc/ngx_http_waf_module_check.h: In function 'ngx_http_waf_handler_check_white_url': ngx_waf-3.1.0/inc/ngx_http_waf_module_check.h:386:13: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < srv_conf->white_url->nelts; i++, p++) { ^ ngx_waf-3.1.0/inc/ngx_http_waf_module_check.h: In function 'ngx_http_waf_handler_check_black_url': ngx_waf-3.1.0/inc/ngx_http_waf_module_check.h:439:13: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < srv_conf->black_url->nelts; i++, p++) { ^ ngx_waf-3.1.0/inc/ngx_http_waf_module_check.h: In function 'ngx_http_waf_handler_check_black_args': ngx_waf-3.1.0/inc/ngx_http_waf_module_check.h:496:13: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < srv_conf->black_args->nelts; i++, p++) { ^ ngx_waf-3.1.0/inc/ngx_http_waf_module_check.h: In function 'ngx_http_waf_handler_check_black_user_agent': ngx_waf-3.1.0/inc/ngx_http_waf_module_check.h:553:13: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < srv_conf->black_ua->nelts; i++, p++) { ^ ngx_waf-3.1.0/inc/ngx_http_waf_module_check.h: In function 'ngx_http_waf_handler_check_white_referer': ngx_waf-3.1.0/inc/ngx_http_waf_module_check.h:610:13: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < srv_conf->white_referer->nelts; i++, p++) { ^ ngx_waf-3.1.0/inc/ngx_http_waf_module_check.h: In function 'ngx_http_waf_handler_check_black_referer': ngx_waf-3.1.0/inc/ngx_http_waf_module_check.h:667:13: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < srv_conf->black_referer->nelts; i++, p++) { ^ ngx_waf-3.1.0/inc/ngx_http_waf_module_check.h: In function 'ngx_http_waf_handler_check_black_cookie': ngx_waf-3.1.0/inc/ngx_http_waf_module_check.h:713:9: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < r->headers_in.cookies.nelts; i++, ppcookie++) { ^ ngx_waf-3.1.0/inc/ngx_http_waf_module_check.h:715:13: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t j = 0; j < srv_conf->black_cookie->nelts; j++, p++) { ^ ngx_waf-3.1.0/inc/ngx_http_waf_module_check.h: In function 'check_post': ngx_waf-3.1.0/inc/ngx_http_waf_module_check.h:803:9: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < srv_conf->black_post->nelts; i++, p++) { ^ In file included from ngx_waf-3.1.0/inc/ngx_http_waf_module_core.h:18:0, from ngx_waf-3.1.0/src/ngx_http_waf_module_core.c:1: ngx_waf-3.1.0/inc/ngx_http_waf_module_config.h: In function 'ngx_http_waf_mode_conf': ngx_waf-3.1.0/inc/ngx_http_waf_module_config.h:155:5: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t i = 1; i < cf->args->nelts && modes != NULL; i++) { ^ ngx_waf-3.1.0/src/ngx_http_waf_module_core.c: In function 'ngx_http_waf_handler_url_args': ngx_waf-3.1.0/src/ngx_http_waf_module_core.c:123:13: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t i = 0; check_proc[i] != NULL; i++) { ^ ngx_waf-3.1.0/src/ngx_http_waf_module_core.c: In function 'ngx_http_waf_handler_ip_url_referer_ua_args_cookie_post': ngx_waf-3.1.0/src/ngx_http_waf_module_core.c:188:17: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t i = 0; check_proc[i] != NULL; i++) { ^ make[1]: *** [objs/addon/src/ngx_http_waf_module_core.o] Error 1 make[1]: Leaving directory/home/mock/rpmbuild/BUILD/nginx-module-http-waf-1.18.0'make: *** [modules] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.uC6JxC (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.uC6JxC (%build)
@purplegrape commented on GitHub (Jan 18, 2021):
due to lower version of gcc