error building nginx 1.5.3 on Cygwin

Maxim Dounin mdounin at mdounin.ru
Sat Aug 3 10:47:34 UTC 2013


Hello!

On Fri, Aug 02, 2013 at 09:17:03PM -0400, Kevin Worthington wrote:

> I'm trying to build nginx 1.5.3 on Cygwin using Windows 7. I see the
> following output during "make":

[...]

> cc1: warnings being treated as errors
> src/core/ngx_inet.c: In function `ngx_sock_ntop':
> src/core/ngx_inet.c:236: error: comparison between signed and unsigned
> make[1]: *** [objs/src/core/ngx_inet.o] Error 1
> make[1]: Leaving directory `/home/kworthington/nginx-1.5.3'
> make: *** [build] Error 2
> 
> I would appreciate any help to fix this. Thank you!

Looks like socklen_t is signed in your environment, which results 
in a warning.  Try the following patch:

--- a/src/core/ngx_inet.c
+++ b/src/core/ngx_inet.c
@@ -233,7 +233,7 @@ ngx_sock_ntop(struct sockaddr *sa,
 
         /* on Linux sockaddr might not include sun_path at all */
 
-        if (socklen <= offsetof(struct sockaddr_un, sun_path)) {
+        if (socklen <= (socklen_t) offsetof(struct sockaddr_un, sun_path)) {
             p = ngx_snprintf(text, len, "unix:%Z");
 
         } else {

Alternatively, you may just ignore the warning, it's harmless.

-- 
Maxim Dounin
http://nginx.org/en/donation.html



More information about the nginx mailing list