Conformance
13
4. Conformance
The three-fold definition of conformance is used to broaden the population of conforming
programs and distinguish between conforming programs using a single implementation and
portable conforming programs.
A strictly conforming program is another term for a maximally portable program. The goal is to 5
give the programmer a fighting chance to make powerful C programs that are also highly
portable, without seeming to demean perfectly useful C programs that happen not to be portable,
thus the adverb strictly.
By defining conforming implementations in terms of the programs they accept, the Standard
leaves open the door for a broad class of extensions as part of a conforming implementation. By 10
defining both conforming hosted and conforming freestanding implementations, the Standard
recognizes the use of C to write such programs as operating systems and ROM-based
applications, as well as more conventional hosted applications. Beyond this two-level scheme,
no additional subsetting is defined for C, since the C89 Committee felt strongly that too many
levels dilutes the effectiveness of a standard. 15
Conforming program is thus the most tolerant of all categories, since only one conforming
implementation need accept it. The primary limitation on this license is §5.1.1.3.
Diverse parts of the Standard comprise the “treaty” between programmers and implementors
regarding various name spaces: if the programmer follows the rules of the Standard the
implementation will not impose any further restrictions or surprises: 20
• A strictly conforming program can use only a restricted subset of the identifiers that
begin with underscore (§7.1.3). Identifiers and keywords are distinct (§6.4.1).
Otherwise, programmers can use whatever internal names they wish; a conforming
implementation is guaranteed not to use conflicting names of the form reserved for the
programmer. (Note, however, the class of identifiers which are identified in §7.26 as 25
possible future library names.)
• The external functions defined in, or called within, a portable program can be named
whatever the programmer wishes, as long as these names are distinct from the external
names defined by the Standard library (§7). External names in a maximally portable
program must be distinct within the first 31 characters (in C89, the first 6 characters 30
mapped into one case) (see §5.2.4.1 and §6.4.2).
• A maximally portable program cannot, of course, assume any language keywords other
than those defined in the Standard.
• Each function called within a maximally portable program must either be defined within
some source file of the program or else be a function in the Standard library. 35
One proposal long entertained by the C89 Committee was to mandate that each implementation
have a translation-time switch for turning off extensions and making a pure Standard-conforming
implementation. It was pointed out, however, that virtually every translation-time switch setting
effectively creates a different “implementation,” however close may be the effect of translating