Do non-trivial strictly conforming programs exist?

Jeffrey Kegler jeffrey at algor2.algorists.com
Wed Sep 13 02:46:22 AEST 1989


In article <12570025 at hpclwjm.HP.COM> walter at 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 at algor2.ALGORISTS.COM or uunet!algor2!jeffrey
1762 Wainwright DR, Reston VA 22090



More information about the Comp.std.c mailing list