#275 closed defect (fixed)
Build error __warn_memset_zero_len
Reported by: | Marco Becker | Owned by: | Maxim Dounin |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | nginx-module | Version: | 1.2.x |
Keywords: | ngx_http_autoindex_module | Cc: | |
uname -a: | Linux marco 3.5.0-21-generic #32-Ubuntu SMP Tue Dec 11 18:51:59 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux | ||
nginx -V: |
nginx version: nginx/1.2.6
built by gcc 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1) configure arguments: --sbin-path=/opt/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/etc/nginx/nginx.pid --prefix=/opt/nginx |
Description
I got the following error wehn build the source code with gcc option -O3:
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -O3 -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \ -o objs/src/http/modules/ngx_http_autoindex_module.o \ src/http/modules/ngx_http_autoindex_module.c In file included from /usr/include/string.h:642:0, from src/os/unix/ngx_linux_config.h:26, from src/core/ngx_config.h:26, from src/http/modules/ngx_http_autoindex_module.c:8: In Funktion »memset«, eingefügt von »ngx_http_autoindex_handler« bei src/http/modules/ngx_http_autoindex_module.c:492:13: /usr/include/x86_64-linux-gnu/bits/string3.h:82:30: Fehler: Aufruf von »__warn_memset_zero_len« mit Attributwarnung deklariert: memset used with constant zero length parameter; this could be due to transposed parameters [-Werror] cc1: Alle Warnungen werden als Fehler behandelt make[1]: *** [objs/src/http/modules/ngx_http_autoindex_module.o] Fehler 1 make[1]: Verlasse Verzeichnis '/root/nginx-1.2.6' make: *** [build] Fehler 2
The ./configure options as follows:
./configure --sbin-path=/opt/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/etc/nginx/nginx.pid --prefix=/opt/nginx --with-cc-opt="-O3"
Attachments (2)
Change History (9)
comment:1 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 12 years ago
This patch works around the compile warning without much effort, and it also means we don't have to disable the checking (which is generally useful, and is the default for recent package builds too).
There is no other occurrence of a false positive like this in the codebase btw - this is the only thing I've found that needed a tweak. Any chance it could be merged?
comment:3 by , 12 years ago
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
comment:4 by , 12 years ago
Owner: | set to |
---|---|
Status: | reopened → assigned |
Maxim, please take a look at the enclosed patch and decide what to do with it.
comment:6 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
As this is indeed the only warning generated for the code I've committed the patch, slightly modified to better match style and surrounding code. Thanks.
This seems to be a warning incorrectly generated by Linux headers when high optimization levels are used (see 1, 2). As a workaround you may use
to compile with -O3 on Linux.