wargio / naxsi

NAXSI is an open-source, high performance, low rules maintenance WAF for NGINX

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cc1: warnings being treated as errors

raychl opened this issue · comments

commented

cc1: warnings being treated as errors
/opt/nginx_inst/naxsi-1.4/naxsi_src/naxsi_runtime.c: In function ‘ngx_http_naxsi_is_rule_whitelisted_n’:
/opt/nginx_inst/naxsi-1.4/naxsi_src/naxsi_runtime.c:798: warning: missing initializer
/opt/nginx_inst/naxsi-1.4/naxsi_src/naxsi_runtime.c:798: warning: (near initialization for ‘tmp_hashname.data’)
make[1]: *** [objs/addon/naxsi_src/naxsi_runtime.o] Error 1

Could you try to change that assignment to { { 0 } } ?
Smells like a bug on the compiler. which version of gcc/clang is that one?

commented

Red Hat 5.6 gcc version 4.1.2
调整为 ngx_str_t tmp_hashname = {{ 0 }} 也是编译失败;
我尝试使用 1.3版本的写法,可以编译通过。:ngx_str_t tmp_hashname;
但是类似这样的写法 ngx_str_t tmp_hashname = { 0 };,会有 warning ,在MakeFile 的参数 -Werror 下,告警会编译失败,去掉该参数后可以正常编译。

在Red Hat 7.4 gcc version 4.8.5 版本下,ngx_str_t tmp_hashname = { 0 }; 不会有warning ,能正常编译。

wow, that gcc version is very very old. that is indeed a gcc bug.
i'm closing this bug report since it is not something i can patch.