Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: Do non-trivial strictly conforming programs exist? Keywords: ANSI C strictly conforming Message-ID: <11007@smoke.BRL.MIL> Date: 9 Sep 89 03:02:20 GMT References: <1989Sep8.230612.6629@algor2.algorists.com> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 47 In article <1989Sep8.230612.6629@algor2.algorists.com> jeffrey@algor2.UUCP (Jeffrey Kegler) writes: >One of the hopes I had for the standard was the ability to write >certain programs where portability is guaranteed. I was hoping that >making them strictly conforming would do it. The operative term is "fighting chance". The goal is to give programs a fighting chance at portability. The only way to absolutely guarantee portability would have been to impose such a strait-jacket on conforming implementations that the Standard would have been largely ignored by vendors, and rightly so. >Section 2.2.4.1 says that "the implementation shall be able to >translate and execute at least one program that contains at least one >instance of every one of the following limits." This is loosely >enough worded to allow a conforming implementation to reject almost >any program. The alternative would be to require acceptance of every strictly conforming program that did not exceed any of the limits. (We'd probably have had to name more such limits, too.) That would have precluded conforming implementations in many environments, especially on smaller systems. >Since a strictly conforming program must be portable to them >all, it must embody the lowest common denominator. This can be low >indeed. Perfectly portable programs have always had to obey such constraints. The Standard merely makes clear what they are. It cannot change this fundamental principle of the way the world happens to be. Relatively portable programs only fail on an insignificant fraction of actual implementations. All portability is relative, just as all probabilities are conditional. >In the real world of compiler vendors, examples of implementations >going out of their way to be defective are not hard to find. You must live in a different real world from mine. >I will leave it as an exercise to the reader to think of even sicker >implementations which conform. This, too, has a standard X3J11 term: it's a matter of "quality of implementation". It is infeasible for the Standard to attempt to force conforming implementations to be "nice" (meaning, apparently, acceptable to Jeffrey Kegler). The marketplace is expected to operate to weed out seriously deficient implementations.