[Zlib-devel] infnew-6 available for testing

Gilles Vollant info at winimage.com
Sat Jan 25 09:38:01 EST 2003


There is two warning when compile with version with Visual C++ 7 (from
Visual studio .NET), using level 3 warning




s:\zlib\contrib\miniziptest\inflate.c(570) : warning C4018: '>' :
signed/unsigned mismatch
I replace
            if (BITS(4) + 8 > state->wbits) {
by
            if (((int)(BITS(4) + 8)) > state->wbits) {
To remove warning


s:\zlib\contrib\miniziptest\inflate.c(823) : warning C4018: '>' :
signed/unsigned mismatch
I replace
                    if (state->have + copy > state->nlen + state->ndist)
{
by
                    if (((int)(state->have + copy)) > state->nlen +
state->ndist) {
To remove warning

The warning documentation say :
'expression' : signed/unsigned mismatch :

Comparing a signed and unsigned number required the compiler to convert
the signed value to unsigned.

Possible solution  : 
Cast one of the two types when testing signed and unsigned types for
equality (= =) or inequality (!=). 

-----Original Message-----
From: Zlib-devel-admin at zlib.net [mailto:Zlib-devel-admin at zlib.net] On
Behalf Of Mark Adler
Sent: Sunday, January 05, 2003 3:32 AM
To: zlib-devel at zlib.net
Subject: [Zlib-devel] infnew-6 available for testing


zlib lint-pickers,

Version 6 of the new inflate code is available for testing here:

     http://www.alumni.caltech.edu/~madler/infnew-6.tar.gz





More information about the Zlib-devel mailing list