lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Fri, Apr 4, 2008 at 6:01 AM, Steven Barth <> 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.

Greg F