C Portability

COTTRELL, JAMES cottrell at NBS-VMS.ARPA
Sat Mar 1 06:14:51 AEST 1986


/*
> The point about the "C" being as portable as Stonehenge was made NOT to
> imply that programs should be routinely written in Assembler Language
> (pun not intended), but rather that porting of programs written in "C"
> has its own different set of problems, the solution to some of which are
> noted above.  This is very obvious to organizations, such as mine, that
> distribute "C"-based software for use on many different host systems, all of
> which allegedly have "standard UNIX" and "standard C" (whatever "standard"
> means these days).

If it didn't have `it's own set of problems' your company wouldn't 
exist. Do you think all you have to do is show up at your customer's
site with tar tapes, run a `make install, & go home? Any fool can do that.
 
> Of course, we would never be able to distribute our software for so many
> different host systems if we were required to write the code in Assembler,
> but, on the other hand, we must go through significant coding gymnastics to
> assure the portability including sticking to the "least common multiple" of
> language features and "detuning" programs due to the compiler restrictions
> (authors call them features, of course) on some systems.  We don't have the
> luxury of telling our customers "too bad, your system doesn't have a good
> or standard enough C compiler!"

Ever heard of `#ifdefs'? That way you can write your code for a `normal'
machine & your favorite environment, then put in #ifdefs for other
environments. You may not have the luxury of telling your customers
too bad (you must not be from SUN :-), but you *can* charge them a 
different price for your services. After all, it's the weird ones
that make it harder, let *them* pay for it.

	jim		cottrell at nbs
*/
------



More information about the Comp.lang.c mailing list