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.
This commit is contained in:
Sergey Kandaurov 2018-05-07 09:54:37 +00:00
parent 658a84f425
commit 68b50f71e1
7 changed files with 31 additions and 19 deletions

View File

@ -3264,7 +3264,8 @@ ngx_http_fastcgi_init_params(ngx_conf_t *cf, ngx_http_fastcgi_loc_conf_t *conf,
return NGX_ERROR; return NGX_ERROR;
} }
copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code; copy->code = (ngx_http_script_code_pt) (void *)
ngx_http_script_copy_len_code;
copy->len = src[i].key.len; copy->len = src[i].key.len;
copy = ngx_array_push_n(params->lengths, copy = ngx_array_push_n(params->lengths,
@ -3273,7 +3274,8 @@ ngx_http_fastcgi_init_params(ngx_conf_t *cf, ngx_http_fastcgi_loc_conf_t *conf,
return NGX_ERROR; return NGX_ERROR;
} }
copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code; copy->code = (ngx_http_script_code_pt) (void *)
ngx_http_script_copy_len_code;
copy->len = src[i].skip_empty; copy->len = src[i].skip_empty;

View File

@ -4389,7 +4389,8 @@ ngx_http_grpc_init_headers(ngx_conf_t *cf, ngx_http_grpc_loc_conf_t *conf,
return NGX_ERROR; return NGX_ERROR;
} }
copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code; copy->code = (ngx_http_script_code_pt) (void *)
ngx_http_script_copy_len_code;
copy->len = src[i].key.len; copy->len = src[i].key.len;
size = (sizeof(ngx_http_script_copy_code_t) size = (sizeof(ngx_http_script_copy_code_t)

View File

@ -3493,7 +3493,8 @@ ngx_http_proxy_init_headers(ngx_conf_t *cf, ngx_http_proxy_loc_conf_t *conf,
return NGX_ERROR; return NGX_ERROR;
} }
copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code; copy->code = (ngx_http_script_code_pt) (void *)
ngx_http_script_copy_len_code;
copy->len = src[i].key.len; copy->len = src[i].key.len;
size = (sizeof(ngx_http_script_copy_code_t) size = (sizeof(ngx_http_script_copy_code_t)

View File

@ -1724,7 +1724,8 @@ ngx_http_scgi_init_params(ngx_conf_t *cf, ngx_http_scgi_loc_conf_t *conf,
return NGX_ERROR; return NGX_ERROR;
} }
copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code; copy->code = (ngx_http_script_code_pt) (void *)
ngx_http_script_copy_len_code;
copy->len = src[i].key.len + 1; copy->len = src[i].key.len + 1;
copy = ngx_array_push_n(params->lengths, copy = ngx_array_push_n(params->lengths,
@ -1733,7 +1734,8 @@ ngx_http_scgi_init_params(ngx_conf_t *cf, ngx_http_scgi_loc_conf_t *conf,
return NGX_ERROR; return NGX_ERROR;
} }
copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code; copy->code = (ngx_http_script_code_pt) (void *)
ngx_http_script_copy_len_code;
copy->len = src[i].skip_empty; copy->len = src[i].skip_empty;

View File

@ -1987,7 +1987,8 @@ ngx_http_uwsgi_init_params(ngx_conf_t *cf, ngx_http_uwsgi_loc_conf_t *conf,
return NGX_ERROR; return NGX_ERROR;
} }
copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code; copy->code = (ngx_http_script_code_pt) (void *)
ngx_http_script_copy_len_code;
copy->len = src[i].key.len; copy->len = src[i].key.len;
copy = ngx_array_push_n(params->lengths, copy = ngx_array_push_n(params->lengths,
@ -1996,7 +1997,8 @@ ngx_http_uwsgi_init_params(ngx_conf_t *cf, ngx_http_uwsgi_loc_conf_t *conf,
return NGX_ERROR; return NGX_ERROR;
} }
copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code; copy->code = (ngx_http_script_code_pt) (void *)
ngx_http_script_copy_len_code;
copy->len = src[i].skip_empty; copy->len = src[i].skip_empty;

View File

@ -695,7 +695,8 @@ ngx_http_script_add_copy_code(ngx_http_script_compile_t *sc, ngx_str_t *value,
return NGX_ERROR; 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; code->len = len;
size = (sizeof(ngx_http_script_copy_code_t) + len + sizeof(uintptr_t) - 1) 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; 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->index = (uintptr_t) index;
code = ngx_http_script_add_code(*sc->values, 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; return NGX_ERROR;
} }
code->code = (ngx_http_script_code_pt) code->code = (ngx_http_script_code_pt) (void *)
ngx_http_script_copy_capture_len_code; ngx_http_script_copy_capture_len_code;
code->n = 2 * n; code->n = 2 * n;
@ -1293,7 +1295,8 @@ ngx_http_script_add_full_name_code(ngx_http_script_compile_t *sc)
return NGX_ERROR; 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->conf_prefix = sc->conf_prefix;
code = ngx_http_script_add_code(*sc->values, code = ngx_http_script_add_code(*sc->values,

View File

@ -587,7 +587,8 @@ ngx_stream_script_add_copy_code(ngx_stream_script_compile_t *sc,
return NGX_ERROR; return NGX_ERROR;
} }
code->code = (ngx_stream_script_code_pt) ngx_stream_script_copy_len_code; code->code = (ngx_stream_script_code_pt) (void *)
ngx_stream_script_copy_len_code;
code->len = len; code->len = len;
size = (sizeof(ngx_stream_script_copy_code_t) + len + sizeof(uintptr_t) - 1) size = (sizeof(ngx_stream_script_copy_code_t) + len + sizeof(uintptr_t) - 1)
@ -677,8 +678,8 @@ ngx_stream_script_add_var_code(ngx_stream_script_compile_t *sc, ngx_str_t *name)
return NGX_ERROR; return NGX_ERROR;
} }
code->code = (ngx_stream_script_code_pt) code->code = (ngx_stream_script_code_pt) (void *)
ngx_stream_script_copy_var_len_code; ngx_stream_script_copy_var_len_code;
code->index = (uintptr_t) index; code->index = (uintptr_t) index;
code = ngx_stream_script_add_code(*sc->values, code = ngx_stream_script_add_code(*sc->values,
@ -767,8 +768,8 @@ ngx_stream_script_add_capture_code(ngx_stream_script_compile_t *sc,
return NGX_ERROR; return NGX_ERROR;
} }
code->code = (ngx_stream_script_code_pt) code->code = (ngx_stream_script_code_pt) (void *)
ngx_stream_script_copy_capture_len_code; ngx_stream_script_copy_capture_len_code;
code->n = 2 * n; code->n = 2 * n;
@ -859,7 +860,7 @@ ngx_stream_script_add_full_name_code(ngx_stream_script_compile_t *sc)
return NGX_ERROR; return NGX_ERROR;
} }
code->code = (ngx_stream_script_code_pt) code->code = (ngx_stream_script_code_pt) (void *)
ngx_stream_script_full_name_len_code; ngx_stream_script_full_name_len_code;
code->conf_prefix = sc->conf_prefix; code->conf_prefix = sc->conf_prefix;