long vs. int vs. short guidelines (especially for wizards!!)

Martin Minow minow at decvax.UUCP
Sat Apr 14 10:41:03 AEST 1984


Here are the int/short/long guidelines that we used in a fairly large
product (DECtalk):

Storage allocation (globals and statics) always uses the following
quantities:

char		8-bit maximum, contains a value.
FLAG		Contains only TRUE/FALSE (#defined as char)
INT_16		int that can be stored in a pdp-11 short
INT_32		int that reqires more than a pdp-11 short

Function formal parameters and auto's may use "int" if the argument
was passed as char, int, or INT_16 and the value is expressable
as a pdp-11 short.  This allows the compiler to generate
efficient code for "normal" situations.

The definition of INT_16 and INT_32 is set by architecture-specific
typedef's in a header file.

Martin Minow
decvax!minow



More information about the Comp.unix.wizards mailing list