Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!gatech!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn ) Newsgroups: net.lang.c Subject: Re: One (or two) more for Guy's portability rules Message-ID: <3383@brl-tgr.ARPA> Date: Tue, 19-Nov-85 09:00:03 EST Article-I.D.: brl-tgr.3383 Posted: Tue Nov 19 09:00:03 1985 Date-Received: Thu, 21-Nov-85 04:06:05 EST References: <486@houxh.UUCP> <2600017@ccvaxa> <2883@sun.uucp> Organization: Ballistic Research Lab Lines: 15 > 24. Develop a consistant method of conditionally compiling machine, > system, and compiler-dependent segments. Use #if, rather than > #ifdef to protect yourself against typo's (assuming your preprocessor > warns you of undefined symbols in #if's). I don't recommend this practice. The vast majority of properly- written C source code should be independent of target architecture, and you are much better off isolating system dependencies in separate modules (read, files) than sprinkling them throughout your code. No matter how many #ifdefs you use, the minute your code written like that moves to a new architecture you have a tedious job ahead adding zillions of additional cases throughout a mountain of source code. There is much less work if the actual applications do not need to be modified due to all the system dependencies being contained in a handful of known files.