[tz] localtime.c issue

Ian Abbott abbotti at mev.co.uk
Wed Jul 10 12:17:49 UTC 2013


On 2013-07-10 13:03, Ian Abbott wrote:
> On 2013-07-08 22:19, Alan Barrett wrote:
>> Perhaps this will work without either a compiler warning or potential
>> loss of precision:
>>
>>              seconds = tdays * SECSPERDAY + (time_t)0.5;
>
> For the record, that works fine in clang with no all warnings on, and

That should be "no warnings on".

> the assembler output contains no floating point conversions even with
> optimization turned off.  With optimization off, the generated code is
> also slightly smaller than my version that retained the 'half_second'
> variable with its initial value cast to type 'type_t'.


-- 
-=( 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