lua-users home
lua-l archive

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


On 15/03/2013 12:42, Roberto Ierusalimschy wrote:
>> ...\lua-5.2.2\src\lgc.c(453) : warning C4334: '<<' : result of 32-bit
>> shift implicitly converted to 64 bits (was 64-bit shift intended?)
> 
> How can we answer "no, it was not"?

I think it is more like "yes it was, and that is why I asked for one."

> Or maybe this?
> 
> -                        sizeof(Node) * sizenode(h);
> +                        sizeof(Node) * (size_t)sizenode(h);
> 
They should be equivalent.  The 32-bit int on the right should be
promoted to a 64-bit size_t before multiplication with the size_t on the
left.  If the compiler forgets to do this after transforming the
multiply to a shift, I think that is a compiler bug.

Finn