Nginx 1.0.0/0.8.54 build issue

Igor Sysoev igor at sysoev.ru
Wed Apr 27 19:17:54 MSD 2011


On Wed, Apr 27, 2011 at 10:14:16AM -0400, Wayne E. Seguin wrote:
> Hello!
> 
> I am having an issue with NGinx compiling on an ArchLinux system I have.
> 
> The failure error is:
> 
> # make
> make -f objs/Makefile
> make[1]: Entering directory `/usr/local/src/nginx-1.0.0'
> gcc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter
> -Wunused-function -Wunused-variable -Wunused-value -Werror -g  -I src/core
> -I src/event -I src/event/modules -I src/os/unix -I objs \
>                 -o objs/src/core/ngx_resolver.o \
>                 src/core/ngx_resolver.c
> 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]
> cc1: all warnings being treated as errors
> 
> make[1]: *** [objs/src/core/ngx_resolver.o] Error 1
> make[1]: Leaving directory `/usr/local/src/nginx-1.0.0'
> make: *** [build] Error 2
> 
> Full details of configure.log make.log gcc --version are here,
> 
> https://gist.github.com/944295
> 
> Any help is greatly appreciated. Thank you for your time!

The attached patch should fix the issue.


-- 
Igor Sysoev
-------------- next part --------------
Index: src/event/modules/ngx_epoll_module.c
===================================================================
--- src/event/modules/ngx_epoll_module.c	(revision 3902)
+++ src/event/modules/ngx_epoll_module.c	(revision 3903)
@@ -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	(revision 3903)
@@ -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);
 


More information about the nginx mailing list