Compilation fails with Nginx 1.23
csandanov opened this issue · comments
Chingis commented
Trying to compile as a dynamic module from master branch on Alpine Linux 3.15:
objs/ngx_http_uploadprogress_module_modules.c
/tmp/ngx_http_uploadprogress_module/ngx_http_uploadprogress_module.c: In function 'ngx_http_reportuploads_handler':
/tmp/ngx_http_uploadprogress_module/ngx_http_uploadprogress_module.c:649:39: error: 'r->headers_out.cache_control' is a pointer; did you mean to use '->'?
649 | ccp = r->headers_out.cache_control.elts;
| ^
| ->
/tmp/ngx_http_uploadprogress_module/ngx_http_uploadprogress_module.c:652:28: error: passing argument 1 of 'ngx_array_init' from incompatible pointer type [-Werror=incompatible-pointer-types]
652 | if (ngx_array_init(&r->headers_out.cache_control, r->pool,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| ngx_table_elt_t ** {aka struct ngx_table_elt_s **}
In file included from src/core/ngx_core.h:65,
from /tmp/ngx_http_uploadprogress_module/ngx_http_uploadprogress_module.c:8:
src/core/ngx_array.h:32:29: note: expected 'ngx_array_t *' but argument is of type 'ngx_table_elt_t **' {aka 'struct ngx_table_elt_s **'}
32 | ngx_array_init(ngx_array_t *array, ngx_pool_t *pool, ngx_uint_t n, size_t size)
| ~~~~~~~~~~~~~^~~~~
/tmp/ngx_http_uploadprogress_module/ngx_http_uploadprogress_module.c:658:30: error: passing argument 1 of 'ngx_array_push' from incompatible pointer type [-Werror=incompatible-pointer-types]
658 | ccp = ngx_array_push(&r->headers_out.cache_control);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| ngx_table_elt_t ** {aka struct ngx_table_elt_s **}
In file included from src/core/ngx_core.h:65,
from /tmp/ngx_http_uploadprogress_module/ngx_http_uploadprogress_module.c:8:
src/core/ngx_array.h:27:35: note: expected 'ngx_array_t *' but argument is of type 'ngx_table_elt_t **' {aka 'struct ngx_table_elt_s **'}
27 | void *ngx_array_push(ngx_array_t *a);
| ~~~~~~~~~~~~~^
/tmp/ngx_http_uploadprogress_module/ngx_http_uploadprogress_module.c:675:53: error: 'r->headers_out.cache_control' is a pointer; did you mean to use '->'?
675 | for (i = 1; i < r->headers_out.cache_control.nelts; i++) {
| ^
| ->
cc1: all warnings being treated as errors
make[1]: *** [objs/Makefile:2047: objs/addon/ngx_http_uploadprogress_module/ngx_http_uploadprogress_module.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/tmp/nginx-1.23.0'
make: *** [Makefile:10: build] Error 2
Sergey Maslov commented
Peter Linss commented
Can confirm the patch above works for me.
Sergey Dryabzhinsky commented
Same fail on latest release 1.24
Andy Postnikov commented
Nauris Steins commented
Thank you @mayson it works also with nginx-1.24.0 and nginx-1.26.0
Brice Figureau commented
It would be great if someone would send me a PR, I could merge it officially.
BenBE commented
Any other issues with an existing patch I should take a look for creating a PR?