lua-users home
lua-l archive

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


On 17/03/06, Lisa Parratt <lisa@thecommune.org.uk> wrote:
> Dave Dodge wrote:
> > "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
>
> Hmm - never used to be. I'm fairly certain it was defined as 32 bits as
> the be all and end all at one point.

If that had been the case, there would have been little point having
separate short and long types. The general idea is that int gives you
the most efficient type for your system, and that short may be smaller
than that and long may be larger than that, as long as short is at
least 16 bits and long is at least 32 bits. Relying on the size of int
being portable has been a problem in several projects I've
encountered.

--
Ben Sizer