ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nginx + gcc 4.6 = warnings



On Sat, Apr 23, 2011 at 08:47:25PM +0400, Валентин Бартенев wrote:
> Добрый вечер.
> 
> Если собирать без debug, то свежий gcc, как мне кажется, вполне справедливо 
> замечает:
> src/core/ngx_resolver.c: In function ?ngx_resolver_process_ptr?:
> src/core/ngx_resolver.c:1425:43: error: variable ?qclass? set but not used [-
> Werror=unused-but-set-variable]
> src/core/ngx_resolver.c:1425:36: error: variable ?qtype? set but not used [-
> Werror=unused-but-set-variable]
> 
> вроде бы ничего криминального, но в сочетании с -Werror это приводит к 
> останову сборки: cc1: all warnings being treated as errors
> 
> p. s.
> nginx 1.0.0
> gcc 4.6.0 20110415

Патч.


-- 
Igor Sysoev
Index: src/event/modules/ngx_epoll_module.c
===================================================================
--- src/event/modules/ngx_epoll_module.c        (revision 3902)
+++ src/event/modules/ngx_epoll_module.c        (working copy)
@@ -518,7 +518,6 @@
     ngx_int_t          instance, i;
     ngx_uint_t         level;
     ngx_err_t          err;
-    ngx_log_t         *log;
     ngx_event_t       *rev, *wev, **queue;
     ngx_connection_t  *c;
 
@@ -565,8 +564,6 @@
 
     ngx_mutex_lock(ngx_posted_events_mutex);
 
-    log = cycle->log;
-
     for (i = 0; i < events; i++) {
         c = event_list[i].data.ptr;
 
@@ -587,25 +584,21 @@
             continue;
         }
 
-#if (NGX_DEBUG0)
-        log = c->log ? c->log : cycle->log;
-#endif
-
         revents = event_list[i].events;
 
-        ngx_log_debug3(NGX_LOG_DEBUG_EVENT, log, 0,
+        ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
                        "epoll: fd:%d ev:%04XD d:%p",
                        c->fd, revents, event_list[i].data.ptr);
 
         if (revents & (EPOLLERR|EPOLLHUP)) {
-            ngx_log_debug2(NGX_LOG_DEBUG_EVENT, log, 0,
+            ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
                            "epoll_wait() error on fd:%d ev:%04XD",
                            c->fd, revents);
         }
 
 #if 0
         if (revents & ~(EPOLLIN|EPOLLOUT|EPOLLERR|EPOLLHUP)) {
-            ngx_log_error(NGX_LOG_ALERT, log, 0,
+            ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
                           "strange epoll_wait() events fd:%d ev:%04XD",
                           c->fd, revents);
         }
Index: src/core/ngx_resolver.c
===================================================================
--- src/core/ngx_resolver.c     (revision 3902)
+++ src/core/ngx_resolver.c     (working copy)
@@ -1422,7 +1422,7 @@
     in_addr_t             addr;
     ngx_int_t             digit;
     ngx_str_t             name;
-    ngx_uint_t            i, mask, qtype, qclass, qident;
+    ngx_uint_t            i, mask, qident;
     ngx_resolver_an_t    *an;
     ngx_resolver_ctx_t   *ctx, *next;
     ngx_resolver_node_t  *rn;
@@ -1514,12 +1514,12 @@
 
     an = (ngx_resolver_an_t *) &buf[i + 2];
 
-    qtype = (an->type_hi << 8) + an->type_lo;
-    qclass = (an->class_hi << 8) + an->class_lo;
     len = (an->len_hi << 8) + an->len_lo;
 
     ngx_log_debug3(NGX_LOG_DEBUG_CORE, r->log, 0,
-                  "resolver qt:%ui cl:%ui len:%uz", qtype, qclass, len);
+                  "resolver qt:%ui cl:%ui len:%uz",
+                  (an->type_hi << 8) + an->type_lo,
+                  (an->class_hi << 8) + an->class_lo, len);
 
     i += 2 + sizeof(ngx_resolver_an_t);
 
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.