Subject: Re: libssh2 master 81912f6 cast away a warning.

Re: libssh2 master 81912f6 cast away a warning.

From: Guenter <lists_at_gknw.net>
Date: Mon, 07 Jun 2010 04:31:16 +0200

Alex,
Am 07.06.2010 03:23, schrieb Alexander Lamaison:
> On 7 June 2010 02:17, Guenter<lists_at_gknw.net> wrote:
>> Hi,
>> Am 07.06.2010 01:36, schrieb Alexander Lamaison:
>>>
>>> Why is this cast safe?
>>
>> please explain your concerns.
>
> Casting away warnings concerns me in general. Perhaps this cast is
> safe but if so, the reason is not obvious and should be explained.
> After all, warnings exist for a reason.
true in general. In this case the warning exists because seconds_to_next
is an int while now is time_t which might be unsigned int, or whatever -
but on a 32-bit system both int and time_t are 32-bit, thus even when
time_t is 64-bit on a 64-bit system we can cast to int until year 2038,
after that date we might consider something better ... :)

Gün.

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-06-07