[tz] localtime.c issue

Ian Abbott abbotti at mev.co.uk
Tue Jul 9 10:06:23 UTC 2013


On 2013-07-08 21:09, Andy Heninger wrote:
> This compilation error from the localtime.c in 2013d looks like an
> actual problem. I think time_t is generally an integer type of some sort.
>
> Built using the clang compiler on Linux.
>
> localtime.c:1517:34: error: implicit conversion from 'double' to
> 'time_t' (aka 'long') changes value from 0.5 to 0
> [-Werror,-Wliteral-conversion]
>                  register time_t         half_second = 0.5;
>                                          ~~~~~~~~~~~   ^~~
> 1 error generated.
>
> Thanks,
>    -- Andy Heninger

How about just changing it from an implicit conversion to an explicit one?

	register time_t half_second = (time_t)0.5;

?

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti at mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-



More information about the tz mailing list