Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!ames!uakari.primate.wisc.edu!aplcen!ginosko!uunet!algor2.algorists.com!jeffrey From: jeffrey@algor2.algorists.com (Jeffrey Kegler) Newsgroups: comp.std.c Subject: Re: Do non-trivial strictly conforming programs exist? Message-ID: <1989Sep12.164622.18909@algor2.algorists.com> Date: 12 Sep 89 16:46:22 GMT References: <1989Sep8.230612.6629@algor2.algorists.com> <12570025@hpclwjm.HP.COM> Reply-To: jeffrey@algor2.UUCP (Jeffrey Kegler) Organization: Algorists, Inc. Lines: 54 In article <12570025@hpclwjm.HP.COM> walter@hpclwjm.HP.COM (Walter Murray) writes: >Doug Gwyn writes: > >> The alternative would be to require acceptance of every strictly >> conforming program that did not exceed any of the limits. > >But doesn't the dpANS do just that, in Section 1.7? "A conforming >hosted implementation shall accept any strictly conforming program." I think we have an outright error in the standard. I can only read what the thing says, but I guess the intentions were that 1.7 in the standard be more loosely worded. The wording of 1.7 does contradict the intention as hinted at in the footnote and explicitly stated in the Rationale. The only way to make the standard internally consistent on this point, as it sits, is to read it as defining strictly conforming programs out of existence. >With reference to the example in the basenote, a program can >be strictly conforming even though it contains TWO macro >definitions with 31 parameters in each, can't it? No. The implementation need execute only ONE program containing ONE instance of a 31 parameter macro. (2.2.4.1) The Rationale points out this was explicitly the intent. Confronted with the choice of trying to prevent perverse implementations and of trying to allow ANSI C to be ported to the most restrictive of environments, X3J11 went all the way over to the second, knowingly and as the result of carefully deliberated choice. Conforming implementations can get very perverse indeed as a result. A conforming implementation can: 1) impose special requirements on the "oversize" macro, such as its name, location, etc., 2) do the same thing with function calls with more than one argument, 3) restrict all lines except one to 32 characters (a tempting choice for implementation on screens of 40 character width), 4) allow only one nested parenthesized expression for declarators and one more for full expressions, 5) as the Rationale says, make itself totally unusable in the above ways and a bunch of other ways. I stared at 2.2.4.1 for weeks before I allowed myself to believe it means what it says, neither more nor less. Then I realized the Void. It was all very Zen. > But that doesn't excuse the implementation from accepting a program > which contains more than one such instance, does it? Absolutely, explicitly and intentionally. -- Jeffrey Kegler, Independent UNIX Consultant, Algorists, Inc. jeffrey@algor2.ALGORISTS.COM or uunet!algor2!jeffrey 1762 Wainwright DR, Reston VA 22090