[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.2.0 (rc2) now available
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 28 Nov 2011 14:46:41 -0200
> In my process of trying to compile Lua on various compilers, I found
> that warning on IAR Embedded Workbench for ARM:
>
> Warning[Pa082]: undefined behavior: the order of volatile accesses is
> undefined in this statement ltable.c 82
>
> Knowing that the order of evaluation is undefined scares me a little
> bit, although it might me pointless.
Note that is not order of evaluation, but order of access (only because
of the volatile).
Probably it refers to the second line in this segment:
{ volatile union luai_Cast u; u.l_d = (n) + 1.0; /* avoid -0 */ \
(i) = u.l_p[0] + u.l_p[1]; } /* add double bits for his hash */
We could rewrite the sum as this, but I am not sure it is worth
the trouble:
(i) = u.l_p[0]; (i) += u.l_p[1]; }
-- Roberto