compile errors
lynch1981 opened this issue · comments
here is my build script
lynch@ngx-dev:~/workspace/nginx-1.20.1$ cat build
mod_path=/home/lynch/workspace
./configure --with-debug
--with-cc-opt='-O0'
--add-module=$mod_path/ngx_devel_kit-0.3.2
--add-module=$mod_path/echo-nginx-module-0.36
make -j 2
I enabled all ndk modules in echo-nginx-module
have=NDK_ALL . auto/have
got several compile errors
cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -O0 -I src/core -I src/event -I src/event/modules -I src/os/unix -I /home/lynch/workspace/ngx_devel_kit-0.3.2/objs -I objs/addon/ndk -I objs -I src/http -I src/http/modules -I /home/lynch/workspace/ngx_devel_kit-0.3.2/src -I /home/lynch/workspace/ngx_devel_kit-0.3.2/src -I /home/lynch/workspace/ngx_devel_kit-0.3.2/objs -I objs/addon/ndk
-o objs/addon/src/ndk.o
/home/lynch/workspace/ngx_devel_kit-0.3.2/src/ndk.c
In file included from src/core/ngx_core.h:52,
from /home/lynch/workspace/ngx_devel_kit-0.3.2/src/ndk.h:12,
from /home/lynch/workspace/ngx_devel_kit-0.3.2/src/ndk.c:6:
/home/lynch/workspace/ngx_devel_kit-0.3.2/src/ndk_conf_file.c: In function ‘ndk_replace_command’:
/home/lynch/workspace/ngx_devel_kit-0.3.2/src/ndk_string_util.h:13:66: error: argument to ‘sizeof’ in ‘memcpy’ call is the same pointer type ‘ngx_command_t *’ {aka ‘struct ngx_command_s *’} as the destination; expected ‘ngx_command_t’ {aka ‘struct ngx_command_s’} or an explicit length [-Werror=sizeof-pointer-memaccess]
13 | #define ndk_memcpyp(d,s) ngx_memcpy(d,s,sizeof(s))
| ^
src/core/ngx_string.h:106:59: note: in definition of macro ‘ngx_memcpy’
106 | #define ngx_memcpy(dst, src, n) (void) memcpy(dst, src, n)
| ^
/home/lynch/workspace/ngx_devel_kit-0.3.2/src/ndk_conf_file.c:389:17: note: in expansion of macro ‘ndk_memcpyp’
389 | ndk_memcpyp (cmd, new_cmd);
| ^~~~~~~~~~~
cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -O0 -I src/core -I src/event -I src/event/modules -I src/os/unix -I /home/lynch/workspace/ngx_devel_kit-0.3.2/objs -I objs/addon/ndk -I objs -I src/http -I src/http/modules -I /home/lynch/workspace/ngx_devel_kit-0.3.2/src -I /home/lynch/workspace/ngx_devel_kit-0.3.2/src -I /home/lynch/workspace/ngx_devel_kit-0.3.2/objs -I objs/addon/ndk
-o objs/addon/src/ngx_http_echo_module.o
/home/lynch/workspace/echo-nginx-module-0.36/src/ngx_http_echo_module.c
In file included from /home/lynch/workspace/ngx_devel_kit-0.3.2/objs/ndk_config.c:20,
from /home/lynch/workspace/ngx_devel_kit-0.3.2/src/ndk.c:8:
/home/lynch/workspace/ngx_devel_kit-0.3.2/src/ndk.c: In function ‘ndk_conf_set_http_complex_path_slot’:
/home/lynch/workspace/ngx_devel_kit-0.3.2/src/ndk_complex_path.c:122:17: error: ‘a’ may be used uninitialized [-Werror=maybe-uninitialized]
122 | return post->post_handler (cf, post, a);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -O0 -I src/core -I src/event -I src/event/modules -I src/os/unix -I /home/lynch/workspace/ngx_devel_kit-0.3.2/objs -I objs/addon/ndk -I objs -I src/http -I src/http/modules -I /home/lynch/workspace/ngx_devel_kit-0.3.2/src -I /home/lynch/workspace/ngx_devel_kit-0.3.2/src -I /home/lynch/workspace/ngx_devel_kit-0.3.2/objs -I objs/addon/ndk
-o objs/addon/src/ngx_http_echo_util.o
/home/lynch/workspace/echo-nginx-module-0.36/src/ngx_http_echo_util.c
cc1: all warnings being treated as errors
make[1]: *** [objs/Makefile:1239: objs/addon/src/ndk.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/lynch/workspace/nginx-1.20.1'
make: *** [Makefile:10: build] Error 2
i tried to fix them, here is my patch
@lynch1981 Sorry for not having replied sooner. I actually only saw this a few days ago.
I looked into the code and your patch - which seems valid and correct. When I've got a moment, I'll test it and incorporate it into the Master branch.
I'll reopen for now, but will close it once I've committed the code.
Thanks for having taken the time to report it with a patch, and again sorry for taking so long to reply.
@lynch1981 I've closed this now. Thanks again for your pull request.