Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site brl-tgr.ARPA Path: utzoo!linus!philabs!cmcl2!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn) Newsgroups: net.lang.c Subject: Re: C portability between non-UNIX operating systems. Message-ID: <5120@brl-tgr.ARPA> Date: Sun, 7-Oct-84 23:00:48 EDT Article-I.D.: brl-tgr.5120 Posted: Sun Oct 7 23:00:48 1984 Date-Received: Tue, 9-Oct-84 19:05:04 EDT References: <2208@pur-ee.UUCP> Organization: Ballistics Research Lab Lines: 14 There are (at least) two things to do to write C code that ports across operating systems. First, stick to portable language usage (use "lint" to check this). Second, use only those C library routines that exist across all systems (this is a pretty small subset), or else choose an environment and port the environment to each target system (this is the approach I generally use; it involves more work up front but then all applications port "free" from then on). Unavoidable system dependencies, such as routines to get a single character from a keyboard, should be isolated in separate modules with the SAME interface to the application but of course a different internal implementation on each system. Some of the C tutorial texts give good advice about portability, but others are awful. Plum-Hall publishes a good set of portability guidelines (two versions: one for UNIXes and one for general systems).