[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua Cross Compiler
- From: "Greg Falcon" <veloso@...>
- Date: Fri, 4 Apr 2008 11:49:22 -0400
On Fri, Apr 4, 2008 at 6:01 AM, Steven Barth <email@example.com> wrote:
> > *h++=(char)sizeof(int);
> Int should be 32bit on any platform as definied in C99 standard.
This is not true.
C99 defines a header <stdint.h> with useful typedefs. If your
compiler provides at least one 32-bit, twos-compliment integer type
with no bit padding, then the typedef int32_t will point to one of
them. But the language doesn't require that such a type is provided;
it certainly doesn't require that of int.
The spec only states that int has "the natural size suggested by the
architecture of the execution environment", though it does require
INT_MAX to be at least 32767.