Uses of \"short\" ?

VLD/VMB gwyn at BRL.ARPA
Mon Nov 11 15:29:41 AEST 1985


You ask for a reference for developing good portable code.
Well, "good" is hard, but "portable" is rather simple.
Just stick to what the C Reference Manual says about
the language, and refuse to use whatever you "know"
about your particular system that is not guaranteed
by the language definition.  That would eliminate most
of the usual portability problems found in C code.

Designing your application to be insensitive to the
details of the operating environment is harder.  You
should, as a minimum, identify such dependencies and
isolate them inside per-environment modules that
implement a common "portable" interface to the facilities.
(The STDIO library is an example of such a package;
the "curses" library is another.)  That way only a
small, known piece of your application requires
adaptation when you port the code to a new environment.

Beyond that, you need to wait for Laura's book..



More information about the Comp.lang.c mailing list