[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] Lua 5.2.2 (rc3) now available
- From: Finn Wilcox <finnw@...>
- Date: Fri, 15 Mar 2013 14:57:04 +0000
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.