[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: compiler warnings in 5.1
- From: Mike Pall <mikelu-0512@...>
- Date: Thu, 22 Dec 2005 16:01:02 +0100
Hi,
Todor Totev wrote:
> Other, more interesting issue, is that time_t is 64bit value in this CRT.
> So compiler complains that
>
> ..\..\src\loslib.c(182) : warning C4244: 'function' : conversion from
> 'time_t' to 'lua_Number', possible loss of data
>
> I don't know how and if this will affect lua in short term (if I remember
> correctly 32bit time_t will serve us till year 2038 or so).
Well, depends on the type of lua_Number. A float can't hold even
a 32 bit time_t with single second accuracy as of 2005 (we are at
0x43aa**** right now). A double can hold the time with single
second accuracy for another 285 million years. Good enough?
But a double cannot accurately represent every 64 bit integer.
That's what the compiler is complaining about.
In fact when you change lua_Number to anything else than a double,
you will get tons of warnings. Some can be ignored, some better
not be ignored. It's tough to remove all of the harmless ones for
every compiler out there.
Bye,
Mike