[Zlib-devel] zLib warning with VC++ 2005

Gilles Vollant info at winimage.com
Fri Jul 15 17:15:24 EDT 2005


 

-----Original Message-----
From: William A. Rowe, Jr. [mailto:wrowe at rowe-clan.net] 
Sent: Friday, July 15, 2005 10:18 PM
To: zlib-devel at zlib.net
Subject: Re: [Zlib-devel] zLib warning with VC++ 2005

At 12:58 PM 7/14/2005, Gilles Vollant wrote:
>>With Visual studio 2005 beta 2, when we compile to 32 bits target with 
>>/WP64 option, we have these warning
>>
>>..\..\..\trees.c(773) : warning C4267: '=' : conversion from 'size_t' 
>>to 'ush', possible loss of data

> I'm not sure you can trust /WP64 to generate warnings; it's far more
reliable to simply build 64 bit modules and determine 
> from those included headers what the true conflicts really are.

>I'm guessing that VC isn't catching all the subtleties of what the Win64
declarations would really be if you build for 64 bits.

Probably, but this is not the question.
Pehaps a porting strategy can be compile 32 bits with /Wp64, take a look on
warning and fix them, and later compile to 64 bits,

BUT we known we will have people which compile using Visual Studio 2005 to
32 bits with /Wp64 enable. And VS2005 turn on this switch when we just
create a 32 bits project from scratch.

The question we must answer now is :
Is replacing on line 223 of three.c 

    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
by 
    s->bi_buf = (ush)((ush)val >> (Buf_size - s->bi_valid));\

can be a problem for anyone (compatibility, at this stage, or just found it
awful :-)). If this is a problem,we don't change and somes Visual C++ user
will have the warning
If we think the modification is not a problem, we can apply the change.

This modification will be useful for somes people, I'm interrested to known
if anyone is against it.

I think this modification is very very trivial and cannot add new bug, but I
can understand if Mark decided change nothing in the code now :-)

Regards
Gilles Vollant





More information about the Zlib-devel mailing list