Richard Damon said:
It must accept all strictly conforming programs, but is only required to
translate and execute one of them.
Not even that. The mandated program need not be strictly conforming,
or even have defined behavior. So the bar for what an implementation
must be able to do in terms of which programs it necessarily will
translate is quite low.
The compiler is allowed to fail to
translate any program (except that one special one for conformance) due
to exceeding translator resource limits, and those limits are NOT
restricted to the enumerated list, nor is not exceeding any of them an
assurance that a translation limit will not be hit.
Yes, and that is as it should be, since the nature of those resources
is outside what the Standard concerns itself with, and explicitly so.
One problem with the standard, is that it is leaves a lot of wiggle
room, and it is possible for a pathological compiler to pass the
conformance test due to the way the translation limit rules are written
(unless they have cleaned it up in the latest version).
IMO this property is a problem only for people who are confused about
what it is the Standard sets out to do. The point of standardizing
"the C language" is to define what constitutes an implmentation of C.
Not what constitutes a _good_ implementation, but just what constitues
an implementation. The stipulation in 5.2.4.1 p1 serves that purpose
fairly well, I would say.
Furthermore, there is another important property, often overlooked,
that conforming implementations must satisfy. That property is
conditional correctness: if an implementation does accept a program
and translate it successfully, then when the program is executed (and
assuming the execution environment has sufficient resources to run the
program to completion), then the executable _must do the right thing_
(modulo hardware failures and OS bugs, which are outside the scope of
the Standard) as defined by the semantic descriptions in the Standard.
In other words, for any program that an implementation does translate,
the translation process must have no bugs. Moreover that includes not
just strictly conforming programs but _any_ program that has defined
behavior, including unspecified behavior or implementation-defined
behavior. In practical terms this more stringent requirement is both
more important and sufficient to provide a good level of quality in
all conforming implementations.