Welcome! Log In Create A New Profile

Advanced

strict-aliasing error with gcc44 -O2

Maxim Dounin
December 11, 2009 07:52AM
Hello!

I see the following error when compiling nginx 0.8.29 with gcc44
with -O2:

gcc44 -c -O -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -O2 -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/local/include -I objs -I src/http -I src/http/modules -o objs/src/http/ngx_http_core_module.o src/http/ngx_http_core_module.c
cc1: warnings being treated as errors
src/http/ngx_http_core_module.c: In function 'ngx_http_core_merge_srv_conf':
src/http/ngx_http_core_module.c:2859: error: dereferencing pointer 'sin' does break strict-aliasing rules
src/http/ngx_http_core_module.c:2853: error: dereferencing pointer 'sin' does break strict-aliasing rules
src/http/ngx_http_core_module.c:2857: error: dereferencing pointer 'sin' does break strict-aliasing rules
src/http/ngx_http_core_module.c:2851: note: initialized from here
*** Error code 1

gcc44 is most recent one from FreeBSD ports:

$ gcc44 --version
gcc44 (GCC) 4.4.3 20091201 (prerelease)
....

Other gcc versions I have compile it cleanly (4.2, 4.3 and 4.5),
and quick look at the code in question suggests that it's gcc44
error as aliasing happens with u_char data and should be allowed.
I haven't yet checked it deeply though.

Is anybody already looked at it? It's not really high priority,
but probably worth fixing even if it's gcc44 problem (at least if
not requires to much dances).

Maxim Dounin

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

strict-aliasing error with gcc44 -O2

Maxim Dounin 3257 December 11, 2009 07:52AM

Re: strict-aliasing error with gcc44 -O2

Maxim Dounin 1645 December 20, 2009 04:38AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 76
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready