aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_script.c
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2018-05-07 09:54:37 +0000
committerSergey Kandaurov <pluknet@nginx.com>2018-05-07 09:54:37 +0000
commit68b50f71e193e58ee117ef36f25387cbaa75edf3 (patch)
tree69ae290ce40d3e7a7d9bb703d26e22df64b3e345 /src/http/ngx_http_script.c
parent658a84f4252b65ef060b1d33b2ff0e749902978b (diff)
downloadnginx-68b50f71e193e58ee117ef36f25387cbaa75edf3.tar.gz
nginx-68b50f71e193e58ee117ef36f25387cbaa75edf3.zip
Silenced -Wcast-function-type warnings (closes #1546).
Cast to intermediate "void *" to lose compiler knowledge about the original type and pass the warning. This is not a real fix but rather a workaround. Found by gcc8.
Diffstat (limited to 'src/http/ngx_http_script.c')
-rw-r--r--src/http/ngx_http_script.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c
index 96f3ec696..1a8773561 100644
--- a/src/http/ngx_http_script.c
+++ b/src/http/ngx_http_script.c
@@ -695,7 +695,8 @@ ngx_http_script_add_copy_code(ngx_http_script_compile_t *sc, ngx_str_t *value,
return NGX_ERROR;
}
- code->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code;
+ code->code = (ngx_http_script_code_pt) (void *)
+ ngx_http_script_copy_len_code;
code->len = len;
size = (sizeof(ngx_http_script_copy_code_t) + len + sizeof(uintptr_t) - 1)
@@ -784,7 +785,8 @@ ngx_http_script_add_var_code(ngx_http_script_compile_t *sc, ngx_str_t *name)
return NGX_ERROR;
}
- code->code = (ngx_http_script_code_pt) ngx_http_script_copy_var_len_code;
+ code->code = (ngx_http_script_code_pt) (void *)
+ ngx_http_script_copy_var_len_code;
code->index = (uintptr_t) index;
code = ngx_http_script_add_code(*sc->values,
@@ -1178,8 +1180,8 @@ ngx_http_script_add_capture_code(ngx_http_script_compile_t *sc, ngx_uint_t n)
return NGX_ERROR;
}
- code->code = (ngx_http_script_code_pt)
- ngx_http_script_copy_capture_len_code;
+ code->code = (ngx_http_script_code_pt) (void *)
+ ngx_http_script_copy_capture_len_code;
code->n = 2 * n;
@@ -1293,7 +1295,8 @@ ngx_http_script_add_full_name_code(ngx_http_script_compile_t *sc)
return NGX_ERROR;
}
- code->code = (ngx_http_script_code_pt) ngx_http_script_full_name_len_code;
+ code->code = (ngx_http_script_code_pt) (void *)
+ ngx_http_script_full_name_len_code;
code->conf_prefix = sc->conf_prefix;
code = ngx_http_script_add_code(*sc->values,