[openib-general] [PATCH] osm: port to WinIB stack - 64 bits

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Sun Oct 15 14:22:46 PDT 2006



Sasha Khapyorsky wrote:
> On 17:45 Sun 15 Oct     , Yevgeny Kliteynik wrote:
>> Hi Sasha,
>>
>> Sasha Khapyorsky wrote:
>>> Hi Evgeny,
>>>
>>> On 16:31 Sun 15 Oct     , Yevgeny Kliteynik wrote:
>>>> Hi Hal
>>>>
>>>> This patch fixes a few data type problems with OSM on 
>>>> 64-bit Windows machines.
>>> Could you explain what those problems are?
>>  
>> Basically, in all three files the problem was assigning
>> the result of pointer arithmetics (which is __int64) to 
>> an int/uint variable.
>> Casting to int is ok because, as I said, this result is 
>> actually string length, index in table, or index in string, 
>> so no range check is required.
> 
> So isn't it better to shut-up compiler warnings/whatever with appropriate 
> warning level flags instead of putting confused castings in the code?

Personally, I don't like the idea of decreasing compiler's 
"suspiciousness" - it will result in writing less portable
code.
Just imagine what would it take to port OSM from Linux to 
Windows, if the Linux code wasn't originally compiled with 
a strict compiler.
 
> (I know there are couple of such already, but I don't think it was a
> good idea). 

IMO, small price to pay.


--
Yevgeny
> Sasha
> 




More information about the general mailing list