Welcome! Log In Create A New Profile

Advanced

Nginx 1.2.1 warning when using clang

Wendal Chen
June 25, 2012 11:54PM
OpenSUSE 11.4 using clang

warning :

src/core/nginx.c:487:37: warning: array index of '3' indexes past the end
of an array (that contains 3 elements) [-Warray-bounds]
if (ngx_strcmp(var[i].data, "TZ") == 0
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
src/core/ngx_string.h:57:70: note: expanded from:
#define ngx_strcmp(s1, s2) strcmp((const char *) s1, (const char *) s2)
^
/usr/include/bits/string2.h:817:28: note: expanded from:
: __strcmp_gc (s1, s2, __s2_len))
\
^
/usr/include/bits/string2.h:911:27: note: expanded from:
(__const char *) (s2))[3]);
\
^ ~
1 warning generated.
src/core/ngx_file.c:384:27: warning: array index of '3' indexes past the
end of an array (that contains 3 elements) [-Warray-bounds]
if (ngx_strcmp(p, "rw") == 0) {
~~~~~~~~~~~~~~^~~~~
src/core/ngx_string.h:57:70: note: expanded from:
#define ngx_strcmp(s1, s2) strcmp((const char *) s1, (const char *) s2)
^
/usr/include/bits/string2.h:817:28: note: expanded from:
: __strcmp_gc (s1, s2, __s2_len))
\
^
/usr/include/bits/string2.h:911:27: note: expanded from:
(__const char *) (s2))[3]);
\
^ ~
src/core/ngx_file.c:387:34: warning: array index of '2' indexes past the
end of an array (that contains 2 elements) [-Warray-bounds]
} else if (ngx_strcmp(p, "r") == 0) {

..... and more ....
--
Wendal Chen
GuangDong China
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx 1.2.1 warning when using clang

Wendal Chen June 25, 2012 11:54PM

Re: Nginx 1.2.1 warning when using clang

Maxim Dounin June 26, 2012 03:02AM

Re: Nginx 1.2.1 warning when using clang

shahzaib mushtaq June 26, 2012 04:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 321
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready