ISO IEC 9899:2018 pdf download – Information technology – Programming languages – C.
4. Conformance
In this document, “shall” is to he interpreted as a requirement on an implementation or on a program; conversely, “shall not” is to be interpreted as a prohibition.
If a “shall” or “shall not” requirement that appears outside of a constraint or runtime-constraint is violated, the behavior is undefined. Undefined behavior is otherwise indicated in this document by the words “undefined behavior” or by the omission of any explicit definition of behavior. There is no difference in emphasis among these three; they all describe “behavior that is undefined”.
A program that is correct in all other aspects, operating on correct data, containing unspecified behavior shall be a correct program and act in accordance with 5.1.2.3.
The implementation shall not successfully translate a preprocessing translation unit containing a #error preprocessing directive unless it is part of a group skipped by conditional inclusion. A strictly conforming program shall use only those features of the language and library specified in this document.3 It shall not produce output dependent on any unspecified, undefined, or implementation-defined behavior, and shall not exceed any minimum implementation limit.
The two forms of conforming implementation are hosted and freestanding. A conforming hosted implementation shall accept any strictly conforming program. A conforming freestanding implementation shall accept any strictly conforming program in which the use of the features specified in the library clause (Clause 7) is confined to the contents of the standard headers <float . h>, <iso646.h>, <1imits.h>, <stdalign.h>, <stdarg.h>, <stdbool.h>, <stddef.h>, <stdint.h>, and <stdno return. h>. A conforming implementation may have extensions (including additional library functions), provided they do not alter the behavior of any strictly conforming program.4)
A conforming program is one that is acceptable to a conforming implementation.5) An implementation shall he accompanied by a document that defines all implementation-defined and locale-specific characteristics and all extensions.
Forward references: conditional inclusion (6.10.1), error directive (6.10.5), characteristics of floating types <float . h’ (7.7), alternative spellings <S o646. h> (7.9), sizes of integer types <limits. h> (7.10), alignment <stdal ign. h> (7.15), variable arguments <stda rg . h> (7.16), boolean type and values <stdbool . h’ (7.18), common definitions <stddef. h> (7.19), integer types <stdint. h> (7.20), <stdno return. h> (7.23).
5. Environment
An implementation translates C source files and executes C programs in two data-processing-system environments, which will be called the translation environment and the execution environment in this document. Their characteristics define and constrain the results of executing conforming C programs constructed according to the syntactic and semantic rules for conforming implementations.
Forward references: In this clause, only a few of many possible forward references have been noted.
5.1 Conceptual models
5.1.1 Translation environment
5.1.1.1 Program structure
A C program need not all he translated at the same time. The text of the program is kept in units called source flies, (or preprocessing files) in this document. A source file together with all the headers and source files included via the preprocessing directive #inctude is known as a preprocessing translation unit. After preprocessing, a preprocessing translation unit is called a translation unit. Previously translated translation units may be preserved individually or in libraries. The separate translation units of a program communicate by (for example) calls to functions whose identifiers have external linkage, manipulation of objects whose identifiers have external linkage, or manipulation of data files. Translation units may be separately translated and then later linked to produce an executable program.
Forward references: linkages of identifiers (6.2.2), external definitions (6.9), preprocessing directives (6.10).
5.1.1.2 Translation phases
The precedence among the syntax rules of translation is specified by the following phases.6
1. Physical source file multibyte characters are mapped, in an implementation-defined manner, to the source character set (introducing new-line characters for end-of-line indicators) if necessary. Trigraph sequences are replaced by corresponding single-character internal representations.
2. Each instance of a backslash character (\) immediately followed by a new-line character is deleted, splicing physical source lines to form logical source lines. Only the last backslash on any physical source line shall be eligible for being part of such a splice. A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character before any such splicing takes place.
3. The source file is decomposed into preprocessing tokens7 and sequences of white-space characters (including comments). A source file shall not end in a partial preprocessing token or in a partial comment. Each comment is replaced by one space character. New-line characters are retained. Whether each nonempty sequence of white-space characters other than new-line is retained or replaced by one space character is implementation-defined.
ISO IEC 9899:2018 pdf download – Information technology – Programming languages – C
Note:
If you can share this website on your Facebook,Twitter or others,I will share more.