Mail Archives: djgpp/1997/03/14/13:19:06
art s. kagel IFMX x2697 wrote:
> In general, it is good coding practice top explicitely use long and short
> rather than int since short is guaranteed to be 'at least 16 bits' and
> long is guaranteed to be 'at least 32 bits' while int is only defined as
> 'the efficient word size' which varies from one machine and compiler to
> another.
Since when? All you're guaranteed is that sizeof(short) <= sizeof(int) and
sizeof(int) <= sizeof(long), and, as you say, an int "has the natural size
suggested by the architecture of the execution environment" (ANSI C
6.1.2.5). None of the values are grounded in absolute sizes. In fact, a
char isn't even guaranteed to be 8 bits!
--
Erik Max Francis, &tSftDotIotE / email: max AT alcyone DOT com
Alcyone Systems / web: http://www.alcyone.com/max/
San Jose, California, United States / icbm: 37 20 07 N 121 53 38 W
\
"I am become death, / destroyer of worlds."
/ J. Robert Oppenheimer (quoting legend)
- Raw text -