From 8c97fa9ae4941e11ed000e2fbcc4de66caa447a3 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Tue, 22 Dec 2009 15:15:45 +0000 Subject: fix building by gcc 4.4 with -O2/3/s: dereferencing pointer 'sin' does break strict-aliasing rules --- src/http/ngx_http_core_module.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/http/ngx_http_core_module.h') diff --git a/src/http/ngx_http_core_module.h b/src/http/ngx_http_core_module.h index c240f252c..9ed490a60 100644 --- a/src/http/ngx_http_core_module.h +++ b/src/http/ngx_http_core_module.h @@ -43,7 +43,18 @@ typedef struct ngx_http_core_loc_conf_s ngx_http_core_loc_conf_t; typedef struct { - u_char sockaddr[NGX_SOCKADDRLEN]; + union { + struct sockaddr sockaddr; + struct sockaddr_in sockaddr_in; +#if (NGX_HAVE_INET6) + struct sockaddr_in6 sockaddr_in6; +#endif +#if (NGX_HAVE_UNIX_DOMAIN) + struct sockaddr_un sockaddr_un; +#endif + u_char sockaddr_data[NGX_SOCKADDRLEN]; + } u; + socklen_t socklen; unsigned set:1; -- cgit