# Nginx 1.2.1 warning when using clang

**URL:** <https://www.ruby-forum.com/t/nginx-1-2-1-warning-when-using-clang/220947>\
**Category:** NGINX\
**Created:** [June 26, 2012, 5:54am UTC](https://www.ruby-forum.com/t/nginx-1-2-1-warning-when-using-clang/220947 "2012-06-26T05:54:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [June 26, 2012, 5:54am UTC](https://www.ruby-forum.com/t/nginx-1-2-1-warning-when-using-clang/220947/1 "2012-06-26T05:54:15Z")

</div>

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 …

---

<div class="post-metadata">

**Author:** ![Wendal\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/e19b73/32.png) [@Wendal\_C](https://www.ruby-forum.com/u/Wendal_C)\
**Post date:** [June 26, 2012, 9:01am UTC](https://www.ruby-forum.com/t/nginx-1-2-1-warning-when-using-clang/220947/2 "2012-06-26T09:01:46Z")

</div>

Hello!

On Tue, Jun 26, 2012 at 11:53:26AM +0800, Wendal C. wrote:

> ```
> ^
> 
> ```
> 
> end of an array (that contains 3 elements) [-Warray-bounds]  
> […]

This looks like glibc problem.

Maxim D.
