Abstraction

Mike I'll be mellow when I'm dead Meyer mwm at UCBOPAL.CC
Fri Oct 4 16:30:26 AEST 1985


In article <199 at rtp47.UUCP> Wayne Throop (throopw at rtp47) writes:
>Thus, "bit16", "bit32", and the like are good ideas, but beware.  These
>names should *only* be used where physical layout is the major concern
>(that is, almost nowhere).

There is one other place. If you know that some variable will always fit in
some size (i.e., you could make it a subrange type in Pascal), then
declaring it to be of type int<n> (or uint<n>, if it's unsigned) allows the
compiler to choose the smallest type it will fit in.

On the other hand, if you're worried about speed, you should declare it as
an int if it's small.

I even have a file of typedefs that works for VAX-like machines that declares
int<n> and uint<n> correctly.

	<mike



More information about the Comp.lang.c mailing list