[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [SOLVED] Re: and/or missbehaviour in embedded lua 5.1
- From: Dave Dodge <dododge@...>
- Date: Fri, 17 Mar 2006 08:34:56 -0500
On Fri, Mar 17, 2006 at 01:07:59PM +0000, Lisa Parratt wrote:
> >Ok, this is a serious bug in Lua 5.1. It's only visible if
> >sizeof(int)*2 < sizeof(lua_Number). I.e. it probably only affects
> >16 bit CPUs with lua_Number defined as a double.
>
> ITYM 16 bit CPUs with out of spec C compilers ;) int *should* be 32
> bits, regardless of the architecture.
"int" is still allowed to be 16 bits in C99. The minimum magnitues
from section 5.2.4.2.1 (and Annex E):
#define INT_MAX +32767
#define INT_MIN -32767
If you need a guarantee of at least 32 bits, you have to use long or
perhaps better yet one of the sized typedefs such as int_least32_t.
-Dave Dodge
- References:
- Re: and/or missbehaviour in embedded lua 5.1, Andreas Stenius
- Re: and/or missbehaviour in embedded lua 5.1, Kein-Hong Man
- Re: and/or missbehaviour in embedded lua 5.1, Andreas Stenius
- Re: and/or missbehaviour in embedded lua 5.1, Kein-Hong Man
- Re: and/or missbehaviour in embedded lua 5.1, Andreas Stenius
- Re: and/or missbehaviour in embedded lua 5.1, Kein-Hong Man
- Re: and/or missbehaviour in embedded lua 5.1, Andreas Stenius
- [SOLVED] Re: and/or missbehaviour in embedded lua 5.1, Andreas Stenius
- Re: [SOLVED] Re: and/or missbehaviour in embedded lua 5.1, Mike Pall
- Re: [SOLVED] Re: and/or missbehaviour in embedded lua 5.1, Lisa Parratt