>> When I built OpenSSL 1.0.1j for Win64 I had several hundred loss of data
>> warnings, most like this:
>>
>> warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of
>> data
>>
>> Loss of data warnings can be serious or benign as you know. Is there a
>> list of known warnings that are expected and benign, or is anything
>> being done handle them? Also, since I have just started building for x64
>> I'm not sure if this is just me or everyone. I've attached all the
>> warnings I received when building debug-VC-WIN64A to this e-mail. Thanks
> 
> I used to verify that those warnings are benign prior major releases. I
> even used to believe that it was mentioned in INSTALL.W64, but
> apparently not. Well, it's not really right thing to do. The reason for
> why right thing wasn't done is historical. Initially Win64 support was a
> kind of compromise (as mentioned in INSTALL.W64), even when it came down
> to time spent on it. I mean choice was between verify that they are
> benign now or take time doing thorough job addressing them. And since
> then it dragged on... It should and will be addressed, thanks for reminder.

Oh, more comes back... Another contributing factor for not doing
something more specific at the time is following. It's easy to just
cast, but question pops up if it's actually safe to do so. Formally you
either have to show that it is, or perform an explicit check. Sometimes
it's more appropriate to harmonize function argument types, size_t-fy
more, and perform check where it's more appropriate. But changing
argument types is touchy subject when it comes to maintaining binary
compatibility. Reasoning was that it would be more appropriate to keep
the warnings, so that they can be examined more thoroughly at later
point, rather than to just mechanically cast everything and risk
introducing subtle problem(s). As mentioned, the warning are being
periodically examined, and criteria for letting one slide is that it
would be same problem on other systems. Let me clarify a little bit
here. Win64 is different from other 64-bit systems by being P64, while
other systems are LP64. LP64 means pointer, size_t and long are 64 bits
wide. P64 on the other hand means pointer and size_t are 64 bits, while
integer and long are 32 bits. Latter means that size_t -> long is
subject to potential loss of data on Win64, but not on other platforms.
Now note that size_t -> int is subject to potential loss on *all* 64-bit
platforms. The warnings that are left alone are those of *latter* type.
This means that if there actually are data loss problems, they are
present on all 64-bit platforms. To paraphrase, warning are kept as
reminder that something needs to be done on all platforms. [And that
something is not necessarily just cast.]

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to