Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!nrl-cmf!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Just what does "portable" mean? Message-ID: <8717@smoke.BRL.MIL> Date: 22 Oct 88 18:43:56 GMT References: <8810111934.AA21941@ucbarpa.Berkeley.EDU> <8308@alice.UUCP> <23933@wlbr.EATON.COM> <1988Oct19.192548.28438@ateng.ateng.com> <4412@bsu-cs.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 23 In article <4412@bsu-cs.UUCP> dhesi@bsu-cs.UUCP (Rahul Dhesi) writes: >Your best bet is to (a) identify the target audience, and (b) pander to >the whims and fancies of its C compilers. Then you are "portable >enough", and that is what really matters. (a) is not practical. Nearly every large chunk of C code I've seen that is more that a few years old is now running on systems that were unanticpated when it was written. The point of the C Standard is to serve as a "treaty point" between C programmers and C compiler vendors. Obviously it is too soon to expect ANSI C conformance (there isn't even an ANSI C standard yet). The only de facto C standards to this point have been K&R 1st Edition and the AT&T UNIX PCC implementation. One thing that programmers concerned about portability should do is make every effort to confine their use of language features to the common intersection of the de facto standards and the forthcoming official standard. (Prototypes are so useful that some of us recommend coding for both old and new styles of function declaration, using #if __STDC__ conditionals. This can also be used to configure the right standard header inclusions.) There is of course much more to portability than merely following language rules, but if you DON'T follow the rules your code will DEFINITELY be non-portable.