Do non-trivial strictly conforming programs exist?

Doug Gwyn gwyn at smoke.BRL.MIL
Sat Sep 9 13:02:20 AEST 1989


In article <1989Sep8.230612.6629 at algor2.algorists.com> jeffrey at 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.



More information about the Comp.std.c mailing list