v1.9.5: compiler warning

173279834462 nginx-forum at nginx.us
Wed Sep 23 16:49:47 UTC 2015


Patch applied to zlib...
Zero errors and zero warnings compiling nginx 1.9.5 with clang/llvm 3.7.0. 
Well done...

--- inflate.c.orig	2015-09-23 18:22:54.000000000 +0200
+++ inflate.c	2015-09-23 18:23:45.000000000 +0200
@@ -1504,9 +1504,10 @@
 {
     struct inflate_state FAR *state;
 
-    if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
+    if (strm == Z_NULL || strm->state == Z_NULL)
+       return (long)(((unsigned long)0 - 1) << 16);
     state = (struct inflate_state FAR *)strm->state;
-    return ((long)(state->back) << 16) +
+    return (long)(((unsigned long)((long)state->back)) << 16) +
         (state->mode == COPY ? state->length :
             (state->mode == MATCH ? state->was - state->length : 0));
 }

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,261756,261781#msg-261781



More information about the nginx mailing list