[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.3.0 (work1) now available
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 8 Jul 2013 22:38:56 -0300
> Without the casts, you might get signed overflow, and signed overflow
> has undefined results in C. Real compilers take advantage of this
> during optimization (it's not just a theoretical issue), meaning that
> the result may not be what you wanted, even when the hardware itself
> uses a straightforward twos-complement representation...
Also, several CPUs have instructions that raise interruptions when they
detect overflows. Doing the arithmetic with unsigneds is a way to ensure
that the compiler will not use these instructions.
-- Roberto
- References:
- Re: [ANN] Lua 5.3.0 (work1) now available, Miles Bader
- Re: [ANN] Lua 5.3.0 (work1) now available, liam mail
- Re: [ANN] Lua 5.3.0 (work1) now available, Miles Bader
- Re: [ANN] Lua 5.3.0 (work1) now available, Tony Finch
- Re: [ANN] Lua 5.3.0 (work1) now available, Philipp Janda
- Re: [ANN] Lua 5.3.0 (work1) now available, Finn Wilcox
- Re: [ANN] Lua 5.3.0 (work1) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.3.0 (work1) now available, Jay Carlson
- Re: [ANN] Lua 5.3.0 (work1) now available, William Ahern
- Re: [ANN] Lua 5.3.0 (work1) now available, Miles Bader