lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sun, Jan 4, 2015 at 4:21 PM, Lorenzo Donati
<lorenzodonatibz@tiscali.it> wrote:
> Ok, interesting. May I know why you chose "long long" instead of int64_t
> instead? The former is 64 bit *at least*, whereas the latter is guaranteed
> to be exactly 64 bit IIRC. Is Lua code "protected" against long long being
> bigger than that (I'm guessing there are platforms for which long long could
> be well 128 bit)?
>
> Cheers!
>
> -- Lorenzo

long long is guaranteed to exist by C99. uint64_t is not -- if a
platform doesn't offer a type that's EXACTLY 64 bits, uint64_t must be
left undefined. (There's uint64_least_t for the smallest type >= 64
bits, and uint64_fast_t for the compiler's opinion of the fastest type
that's at least 64 bits. These will be defined if a machine has e.g.
72-bit registers.)

/s/ Adam