The C compiler is implemented as a C standard, depending on the C standard diagnostic rules and library definitions. C standard points out:
1.4 Implementation Compliance [Intro.compliance]
The set of diagnosable rules consist of all syntactic and semantic rules in this Internationa Standard except for those rules containing an explicit notation that "no diagnostic is required" or which are described as resulting in "undefined behavior." "Diagnosable rule" collection Including all grammar and semantic rules in this standard in addition to being explicitly marked as "no need to diagnose" or describe "leading to undefined behavior".
Although this International Standard states only requirements on C implementations, those requirements are often easier to understand if they are phrased as requirements on programs, parts of programs, or execution of programs Such requirements have the following meaning:. Although this standard only stated C The implementation of the specifications, but they are often more easily understood by the specifications of the program, program fragment, and programs. These specifications contain the following meaning:
If a program contains no violations of the rules in this International Standard, a conforming implementation shall, within its resource limits, accept and correctly executei) that program. Implement standard if a program does not violate the rules of this standard, in line should its resources Under restriction conditions, accept and correctly perform I) this program. i) "Correct Execution" can include undefined behavior, depending on the data being process; see 1.3 and 1.9. "Correct execution" may also produce undefined behavior, which is dependent on the data processed by the program. See 1.3 and 1.9. If A Program Contains a Viocation of Any Diagnostation Shall Issue a Least ONE Diagnostic Message, Except That If a program violates any diagnostic rules, the standard implementation should give at least one diagnostic message unless IF a Program Contains a Viocnostic IS Required, this International Standard Places No Requirement On Implementations with Respect To That Program. If a program violates the rules that do not need to be diagnosed, this program will not be required to implement any specifications.
For classes and class templates, the library clauses specify partial definitions. Private members (clause 11) are not specified, but each implementation shall supply them to complete the definitions according to the description in the library clauses. For classes and template classes, standard library The chapter only specifies some of their partial definitions. Although there is no specific provision, each implementation should provide private members (chapter 11) to complete the definitions of classes and templates in accordance with the standard library chapter. For functions, function templates, objects, and values, the library clauses specify declarations. Implementations shall supply definitions consistent with the descriptions in the library clauses. For functions, function templates, objects and values, the standard library section spelling out their statement. Each implementation should provide a definition consistent with the description of the standard library chapter.
The names defined in the library have namespace scope (7.3). A C translation unit (2.1) obtains access to these names. Defined in the standard library name has a namespace scope (7.3 by including the appropriate standard library header (16.2) ). The C compilation unit (2.1) can obtain the ability to access these names by including the appropriate standard library header file (16.2).
The templates, classes, functions, and objects in the library have external linkage (3.5). The implementation provides definitions for standard library entities, as necessary, while combining translation units to form a complete C program (2.1). The standard library templates , Classes, functions, and objects have external connections (3.5). When the combined compilation unit is referred to as a complete C program (2.1), the implementation should provide a definition of standard library entities as needed.
Two kinds of implementations are defined:.. Hosted and freestanding For a hosted implementation, this International Standard defines the set of available libraries A freestanding implementation is one in which execution may take place without the benefit of an operating system, and has an implementation- Defined Set of Libraries That Includort Certain Language-Support Libraries (17.4.1.3). This standard defines two types of implementation: parasitic implementation and native implementation. This standard defines the available standard libraries for parasitic implementation. Programs in native implementation do not have support for operating systems with a library with a set of implementations that contain a particular language support library. A conforming implementation may have extensions (including additional library functions), provided they do not alter the behavior of any well-formed program. Implementations are required to diagnose programs that use such extensions that are ill-formed according to this International Standard. Having done SO, HOWEVER, THEY CAN Compile and Execute Such Programs. Compliant standard implementation can have extended (including additional library functions), as long as these extensions do not change any of the complete programs. Implementation should be diagnosed with these extensions to be illustrated in accordance with this standard. However, these programs can be compiled and executed thereby.