title>GB/T 15272-1994 Programming language C - GB/T 15272-1994 - Chinese standardNet - bzxz.net
Home > GB > GB/T 15272-1994 Programming language C
GB/T 15272-1994 Programming language C

Basic Information

Standard ID: GB/T 15272-1994

Standard Name: Programming language C

Chinese Name: 程序设计语言C

Standard category:National Standard (GB)

state:in force

Date of Release1994-12-07

Date of Implementation:1995-08-01

standard classification number

Standard ICS number:Information technology, office machinery and equipment >> 35.060 Languages ​​for information technology

Standard Classification Number:Electronic Components and Information Technology>>Information Processing Technology>>L74 Programming Language

associated standards

Procurement status:ISO/IEC 9899-1990

Publication information

publishing house:China Standards Press

ISBN:155066.1-11699

Publication date:2004-07-25

other information

Release date:1994-12-07

Review date:2004-10-14

drafter:Jin Yimin, Chen Ping, Feng Hui, Sun Yu, Fang Duanxiang, Huang Jiaqi, Zhou Mingde

Drafting unit:Xidian University

Focal point unit:Standardization Institute of the Ministry of Electronics Industry

Proposing unit:Ministry of Electronics Industry of the People's Republic of China

Publishing department:State Bureau of Technical Supervision

competent authority:National Standardization Administration

Introduction to standards:

This standard specifies the form of programs written in the programming language C and their interpretation. NOTE This standard is designed to promote the portability of C programs between data processing systems. The primary audience for this standard is implementers and programmers. A basic document associated with this standard explains many of the decisions of the technical committee that prepared this standard. This standard specifies: - the representation of C programs; - the syntax and constraints of the C language; - the semantic rules for interpreting C programs; - the representation of input data processed by C programs; - the representation of output data produced by C programs; - the restrictions and limits on conforming C implementations. This standard does not specify: - a mechanism for transforming C programs for use with a data processing system; - a mechanism for calling C programs for use with a data processing system; - a mechanism for transforming input data for use with a C program; - a mechanism for transforming output data after it has been produced by a C program; - the length and complexity of C programs and their data that would exceed the capabilities of any particular data processing system or particular processor; - the overall minimum requirements for supporting a conforming implementation. GB/T 15272-1994 Programming Language C GB/T15272-1994 standard download decompression password: www.bzxz.net

Some standard content:

National Standard of the People's Republic of China
Programming languages—C
This standard adopts the International Standard IS0/IF:9899—1990 & IS0/1Rt: 9899-1990
With the introduction of new devices and extended character sets, new features may be added to the standard. The relevant provisions in the language and library clauses give implementers and programmers a warning to use features that, although legal in themselves, may conflict with the content of the specified additions. Some features are subject to deprecation, which means that they may be withdrawn in future versions of the standard. The reason why they are still retained in this standard is that these features are widely used, but it is not encouraged to use these features in new implementations or to use these language features (see 6.9) or library features (see 7.13) in new programs. The text of this standard is divided into the following main parts: States and basic elements:
Characteristics of the environment for translation and execution (processing) Grammar, constraints and semantics of the language:
Array facilities.
In some texts, examples are given to illustrate possible forms of the described components. Notes are added to emphasize the effect of the rules described in the corresponding clause or other places in the standard: references are given when other relevant clauses are mentioned. The appendix summarizes the borrowings contained in the standard: citations, examples, notes, references and appendices are not part of the standard. Chapter 6 The language is derived from \The C Reference Manual\. Chapter 7 is based on the 1984 standard of the FC Users Association (1984/usi/gruup5tandlard). : Subject matter and scope
This standard specifies the form and interpretation of programs written in the programming language () book. Note: The purpose of designing this standard is to promote the portability of core programs between various data processing systems. The main users of this standard are programmers and programmers who are related to this standard. The "basic document interpretation" and many decisions of the technical committee that prepared this standard. This standard specifies:
--Representation of C programs 1
The syntax and constraints of the C language:
Interpretation (semantic representation of C programs,
Representation of input data processed by the program;
Representation of input data processed by the program by C The representation of output data generated by the program; the restrictions and limits on C programs that comply with the standard. This standard does not specify the following:
Mechanisms for transforming C programs for use in data processing systems; mechanisms for using programs for use in data processing systems; Approved by the State Bureau of Technical Supervision on December 7, 1994 and implemented on August 1, 1995
GB/T 15272-94
"A mechanism for transforming input data for use by a C program: A mechanism for transforming output data after it is generated by a C program; a mechanism for transforming the length and complexity of a C program and its data beyond the capacity of any particular data processing system or processor: All minimum requirements for supporting an implementation that complies with the standard. 2 Referenced standards
GB1988 Information processing Seven-bit coded character set for information interchange GB5271 Data processing vocabulary 1
GH12406 Codes for representing currency and funds
ANSI/IEEE754-binary floating-point arithmetic 2
3 Definitions and definitions
In this standard, the verb "shall" is interpreted as a requirement that an implementation or program should make. Conversely, the verb "shall not" is interpreted as prohibiting the following definitions from applying to this standard. Terms explicitly defined in this standard shall not be assumed to imply similar terms defined elsewhere. Terms not defined in this standard shall be interpreted in accordance with GB 5271. 3.1 Alignment
is a requirement that objects of a particular type should be placed at a storage boundary that is a specific multiple of a byte address. 3.2 real argument
is an expression in a parenthesized list separated by commas in a function call, or a series of preprocessor words in a parenthesized list separated by commas in a function-like macro call. Also called a "real argument". 3.3 (bit) hit
A unit of data storage in the execution environment that shall be large enough to hold an object that may have one of two values. It is not required to be able to express the address of every individual bit in an object.
3.4 byte
A unit of data storage that is large enough to hold any member of the basic symbol set in the execution environment. It shall be able to express the address of every individual byte in an object. A segment consists of a series of contiguous bits, or the number of bits in a byte is implementation-defined. The least significant binary digit of a character string is called the low bit, and the most significant binary digit is called the high bit. 3.5 character
-A binary representation that can fit into one byte. The representation of each member of the basic character set of the source and execution environments shall fit into one byte.
3.6 constraints
A syntactic or semantic restriction that further explains the language element comment. 3.7 Diagnostic message diagnosticmessage implements output message "set! Class message, which is implementation-defined. 3.8 Farward reference clause farward reference to the subsequent clause of the standard that contains relevant information about the current clause. 3.9 ilementatian
A specific set of software that runs in a specific translation environment that is subject to special control options and is implemented for a specific execution environment. Description:
Equivalent to IS02382, which appears in Chapter 3 of the technical standard. 1jGB 5271
2]ANSI/IEEE754 appears in Chapter 5 of this standard CE/T15272--94
The translation of the program and supports the execution of functions in this execution environment. 3. The implementation of the implemeniation-drfined 3.11 Implementation-defined limits The limits imposed by the implementation on strong ordering.
3.12 Locale-specific behavior Locale-specific behavior The behavior that depends on locale, country, culture, and language. Each implementation shall document this behavior. 3.13 Multibyte character A sequence of one or more bytes that represents a member of an extended character set in the source or execution environment. The extended character set is a superset of the basic character set.
3.14 Object An area of ​​data storage in the execution environment whose contents represent a value. Except for segments, an object consists of one or more contiguous bytes, the number of bytes in an object being either explicitly specified in the order, encoding, or by the implementation. When referenced, an object may be interpreted as having a particular character type. 2. 2. 1).
3.15 Formal parameter
parameter
An object that is a part of a macro definition with an input value, or an identifier in a list enclosed in parentheses and separated by commas immediately following a macro name with a similar macro definition, also called a "formal parameter". 3.16 Undefined behavior undefined behavior occurs when a non-portable or erroneous program component is used: or erroneous data, or an object whose value cannot be determined! The current standard does not specify these behaviors, Permitted treatment of technically defined behavior includes: completely ignoring the situation despite possible unpredictable consequences: handling as specified in the environment document during translation or program execution (no diagnostic messages are guaranteed); and, if a "shall" or "shall not" requirement is violated outside of a constraint clause, the behavior is undefined. Other undefined behaviors are indicated in the text of this standard by the term "undefined behavior" or by the omission of any explicit definition of the behavior. There is no clear distinction between these three situations; they all describe "undefined behavior". 3.17 Unspecified behavior refers to the behavior of a program component or data that is correct and for which no requirements are imposed by the standard. Example
The order in which the actual arguments of a function are evaluated is an example of undefined behavior. h.
The behavior when integer overflow occurs is undefined. How the high bits are transferred when a signed integer is shifted right is undefined. For symbols other than the 26 lowercase English letters, the return value of the islwe function is a locale-specific behavior.
Previously cited clauses: Bitwise shift operators (6.3.7), expressions (6.3), function calls (6.3.2.2). Interpretation 1.aliWcr (7.3.1.6). Localization library preamble (7.4). 4 Conformance
A conforming implementation shall use only those language and library features specified in this standard. It shall not produce output that has unspecified, undefined, or implementation-defined behavior, nor exceed any implementation-defined minimum limits. Conforming implementations come in two flavors: conforming and independent. A conforming implementation shall accept any strictly conforming program. A conforming implementation shall accept any strictly conforming program whose use of the conventions specified in this standard's "library" is consistent with the standard preambles (std.h), lisr.li), stddef.h, and stddef.h). A conforming implementation may have extensions (including additional library functions) as long as these extensions do not change any behavior of a strictly conforming program..comGB/T 15272—94
Conformance ordering is the ordering that is acceptable to conforming implementations. NOTE: This means that a conforming implementation may not preserve any identifiers other than those explicitly reserved by this standard. You expect strictly conforming programs to be as portable as possible between conforming implementations. Conforming programs may rely on the following non-portable features that are not implemented in the implementation.
An implementation shall be accompanied by documentation that defines all implementation-defined features and their extensions. Prefix 1 Used clauses, limited value preambles (flout.h) and(Article 7.1.5). Variable length actual parameter library leading text coupon(Article 7.8). Public Definition Library Preamble(Clause 7.1.6). 5 Environment
The implementation evaluates the source text and executes the C program in two data processing environments, respectively, referred to as translation environments in this standard. Their characteristics define and constrain the results of executing a compliant program constructed in accordance with the grammatical and semantic rules of the implementation.
Pre-referenced clauses: In Chapter 5 "Environment", a small part of the many possible pre-referenced clauses is given.
5.1 Conceptual model
5.1.1 Translation environment
5.1.1.1 Program structure
Not all C programs need to be translated at the same time. The program text is stored in units called source files in this standard. Each source file together with the preprocessing directive #intludl e All the leading files and source files that are incorporated, minus the source program lines skipped by the import preprocessing directives, are called a translation unit. Previously translated translation units can be kept separately or in a library. · The individual translation units of a program communicate with each other by means such as calling functions with external links to identifiers, operating on objects with external links to identifiers, or operating on data files. The translation units can be translated separately and then linked to produce an executable program. Pre-referenced clauses: conditional incorporation (clause 6.8.1), linkage of identifiers (clause 6.1.2.2), source file incorporation (clause 6.8.2). 5.1.1.2 Translation phases
The precedence between the grammatical rules of translation is specified in the following phases: Phase 1. If necessary, map physical file characters to source character nests (introducing newline characters for line spacing indicators). Replace the triplet sequence with the corresponding single-character internal representation. Phase 2. Delete each backslash character followed by a newline character, splitting the physical source program lines to form logical source program lines. A non-empty source file should end with a newline character, which should not be immediately preceded by a backslash character. Phase 3. Decompose the source file into preprocessing words and a series of white-space characters (including comments). The source file should not end at incomplete preprocessing words or comments. Replace each comment with a space character. Keep the newline characters. Whether the non-empty series of white-space characters other than newlines are kept or replaced with a space character is implementation-defined. Phase 4. Execute Preprocessing directive, expand macro calls. The include preprocessing directive will cause the named header or source file to be processed recursively from stage 1 to stage 4.
Stage 5. Convert the first source character set member and the escape sequence in the character constant and string literal to members of the execution character set.
Stage 6. Concatenate adjacent string literal words and adjacent wide string literal words, Stage 7. White space separating words is no longer significant at this time. Each preprocessing word is converted to a single word. The resulting single words are parsed and semantically analyzed and translated. Stage 8. Resolve all external object references and function references. Link related library components to satisfy external references to objects and functions not defined in the current translation unit. The output of all such translation programs is collected into a program image containing the information generated when executed in its execution environment.
Note: Even though several stages are often combined in practice, an implementation must behave as if these stages were separated. 2; As described in clause 6.1, the process of breaking source text characters into preprocessing tokens is relevant below. As an example, see the processing of the source text in the ..comnludi processing instructions.
GB/T 15272-94
Previous clauses: lexical elements (clause 6.1), preprocessing instructions 16.8), triplet sequences (clause 5.2.1.1) 5.1.1.3 Diagnosis
A conforming implementation shall produce, in at least one implementation-defined way, a diagnostic message for each open unit that violates any grammar rule or constraint. In other cases, no diagnostic message need be generated. Note that the implementation should identify the nature of each violation and locate it if possible. However, an implementation is free to generate any number of diagnostic messages as long as it successfully interprets a legal program. An implementation may also successfully interpret an illegal program. 5.1.2 Execution Environments
Two execution environments are defined: initialization and deinitialization. In both environments, when a function (such as a static storage function) is called by the execution environment, a sequence of operations occurs. All objects in static storage must be initialized before the program is started! For other purposes, this type of initialization is not specified elsewhere. The clause that is referenced in advance when the sequence of operations returns control to the execution environment: initialization (clause 6.5.7). 5.1.2.1 Stand-alone Environment
In a stand-alone environment, that is, an environment in which a program executes without any support from the operating system, the names and types of the variables that a program invokes when it is restarted are implementation-defined. Otherwise, no external identifiers are reserved. All facilities available to a stand-alone program are implementation-defined.
In a stand-alone environment, the effects of program termination are also implementation-defined. 5.1.2.2 Recurrent Main Environment
It is not necessary to provide a post-main environment, but it is recommended that it be provided. The following specifications should be followed. 5.1.2.2.1 Program Startup
When a program starts up, a function named main is called. The implementation need not declare a prototype for this function. It can be defined with no parameters:Ent main(void)I/ *.* /)
With two parameters;
int main(int argc, char * argv[J) I/ *..# Although the names argc and argv are used here, they may be used in any way, since they are local to the function in which they are declared. If a function mrin is defined, its parameters shall obey the following conventions: the value of ar shall not be negative;
-argv_argc shall be a null pointer;
-argc:-1|| shall contain pointers to strings. Implementation-defined values ​​are assigned to these strings by the runtime environment before the program starts. The purpose of this is to provide the program with information that is determined by other parts of the host environment before the program starts. If the host environment cannot provide strings that contain both uppercase and lowercase letters, the implementation shall ensure that these strings are received in lowercase. If the value of argr is greater than sign, the string pointed to by argv_o] represents the name of the program. If the program name cannot be obtained from the host environment, argv_o]o shall be a null character. If the value of arg is greater than 1, the long-order parameters pointed to by argv[1 through argv[argc-1] shall be used. The formal parameters argc and argv and the array pointed to by the argv array shall be modifiable by the program and shall retain the values ​​last stored from program startup to program termination: 5.1.2.2.2 Program Execution
In the host environment, the program can use all the functions, schemas, type definitions, and objects described in Chapter 11. 5.1.2.2.3 Program Termination
Returning from the initial call to function main is equivalent to calling function exil with the return value of function main as the actual argument. If function main performs a return operation without specifying a value, the termination status returned to the exil environment is undefined. Definition of terms used in advance (7.1, 1), function exit (7.10.4.3). 5. 1. 2.3 Program execution
The semantic description in this standard describes the execution of an abstract machine in which optimization issues are not involved. CB/T 15272--94
Accessing a volatile object, modifying an object, modifying a file, or calling any of the above operations is considered to be a change in the state of the environment. The evaluation of expressions may have side effects. At certain points in the execution sequence, called sequence points (or points in the order of evaluation), all side effects of previous evaluations shall complete and side effects required by subsequent evaluations shall not occur before then. In the abstract machine, all expressions are evaluated as semantically specified. An implementation need not evaluate any part of an expression if it can infer that the value of the expression is not yet needed and that no necessary side effects, including any side effects caused by calls to functions or accesses to volatile objects, are produced.
When processing of the abstract machine is interrupted by receipt of a signal, only the values ​​of objects that were at the previous sequence point can be relied upon. Between the previous sequence point and the next sequence point Objects that may have been modified during the execution of a sequence point may not have received their correct values. Upon entry into a block containing objects with automatic storage duration, an instance is created for each object with automatic storage duration. Such objects exist and retain their last stored values ​​while the block is executing and when the block is suspended by a function call or a signal:
The minimum requirements for a conforming implementation are: - When at a sequence point, volatile objects are stable in the sense that previous evaluations have completed and subsequent evaluations have not yet occurred. - When the program terminates, all data written to the file shall be the same as it would have been if the program had been executed according to the abstract semantics. :
Dynamic input and output of interactive devices shall occur as specified in Section 7.9.3. The purpose of these requirements is to make the output of the meta-buffer or line-buffer appear as early as possible, ensuring that the prompt message actually appears before the program waits for input. The composition of interactive devices is undefined. A stricter correspondence between abstract semantics and actual semantics may be defined by each implementation. Example
An implementation may define a one-to-one correspondence between abstract semantics and actual semantics, such that at each sequence point the value of the actual object is consistent with the value of the object specified by the abstract
semantics. In this case, the keyword volatile would be redundant. Alternatively, the implementation may also Various optimizations may be performed within each translation unit so that the actual semantics are consistent with the abstract semantics only when a call is made across a translation unit boundary. In such an implementation, for the case where the caller and the callee are in different translation units, the values ​​of all externally linked objects and all objects accessible through pointers will be consistent with the abstract semantics on each entry and return from the function. In addition, on entry to such a function, the values ​​of the formal parameters of the called function and all objects accessible through pointers will be consistent with the abstract semantics. In such an implementation, objects referenced by the interrupt service routine invoked by the sighal function will require explicit specification of volatile storage, as well as other implementation-defined restrictions. h. Executing the following program fragment
char tlic2;
*-- *
crl+c2;
requires the abstract machine to first upgrade the value of each variable to the size of int, then add the two inl variables, and then truncate them. As long as two char values ​​can be added without causing an overflow exception, the actual implementation only needs to produce the same result and the promotion can be omitted. c: Similarly, in the program fragment
flcat f1,12:
double d;
f=f2 * d
, the multiplication can be performed with single precision if the implementation can guarantee the result as if it were performed with double precision (for example, by replacing d with the constant 2., which has the type doubie), or the operation involving only itit or iloa1 can be performed with double precision if neither the range is exceeded nor the precision is lost. dTo explain the behavior of expression combination, in the following program fragment int a, b;
#=a+32760+b+5+
GB/T 15272--94
, due to the associativity and priority of the addition operator, the performance of the above expression statement is indeed the same as the statement =(((a+32760)+b)+5);
. That is, the result of "(a+32760)" is added to b, and 5 is added to the result to get the value assigned. On the machine where the exception is raised and the range of representable values ​​is [-32768, +32767], the implementation cannot rewrite the above expression as: a=((a→b)+32765);
because if the values ​​of a and b are -32754 and -15 respectively, then the sum a+b will produce an exception, while the original expression will not. The above expression cannot be rewritten as:
#=((a+32765)+b);
a=(a+(b+32765));
because a and b could have values ​​of 4 and -8 or -17 and 12 respectively. However, on machines where overflow does not raise an exception and the result of overflow is invariant, the implementation can rewrite the expression into any of the above forms, since they all yield the same result and the combination of expressions does not completely determine its evaluation. In the following program fragment e.
#inelude (stdin. h)bzxZ.net
intsum;
char *p:
=sum # l0-*g* +( *F++=gctchar())+sum:
, the expression statement is composed as if it were written;
sum=(((sum # 10)--*0')+((*(p++))=(getchar(0)));. However, the actual increment of p can appear at any time between the previous sequence point and the next sequence point (semicolon;). For the function getchar A call to an execution character set may occur at any time before its return value is needed. Preceding clauses: compound statements or blocks (clause 6.6.2), expressions (clause 6.3), documents (clause 7.9.3), sequence points (clauses 5.3, 6.6), function sighal (clause 7.7), type qualifiers (clause 6.5.3). 5.2 Environmental considerations
5.2.1 Character sets
Two character sets and their associated sequence sequences shall be defined: the character set used to write source documents and the character set interpreted in the execution environment. The values ​​of the execution character set members are implementation-defined; any Additional characters beyond the requirements of this clause are region-specific. In character constants or literals, members of the execution character set shall be represented by corresponding members of the source character set or by an escape sequence consisting of a reverse character \\ followed by one or more characters. In the basic execution character set there shall be a character whose byte positions are replaced by 0, called the null character. The null character is used to terminate a string literal. Both the basic source character set and the basic execution character set shall have at least the following members: the 26 uppercase letters of the English alphabet
QRST
the 26 lowercase letters of the English alphabet
10 decimal digits
the following 29 graphic characters
GB/T 15272 94
plus the space character and the control characters for horizontal control, vertical tabulation, and page feed. Each character after 0 in the above decimal numeric character set in the source character set and the basic execution character set shall have a value one greater than the value of the preceding character. In the source text, there shall be some way to indicate the end of each line of text. This standard treats this end-of-line indicator as a single newline character. In the execution character set, there shall be control characters for alert, backspace, carriage return, and newline. If any character other than one that appears in a character constant, string literal, preceding text directive, comment, or preprocessing directive that is not converted to a word is encountered in the source text, the behavior is undefined.
Previous references: character constants (6.1.3.1), preprocessing directives (6.8), string literals (5.1.4). Comments (6.1.9).
5. 2. 1. 1
Triplet sequence
The following sequence of three characters is called a triplet sequence. All occurrences of them in the source text are replaced by the corresponding single character. No other triplet sequences exist. No changes are made to ? that do not begin one of the above triplet sequences. Note that triplet sequences allow the entry of characters not defined in GH 1988. (iH 1988 is -L:5.2.1.2 Multibyte Characters The source character set may contain multibyte characters that represent members of the extended character set. The execution character nest may also contain multibyte characters. However, their encodings need not be the same as those of the multibyte characters in the source character set. The following conditions shall hold for both character sets: The single-byte characters defined in 5.2.1 shall be included. The presence, meaning, and representation of any additional members shall be locale-specific. A multibyte character may have encodings that depend on the state. Each multibyte character sequence begins with an initial escape state and enters other implementation-defined escape states when a specific multibyte character is encountered in the sequence. When in the initial escape state, all single-byte characters retain their usual interpretation and the escape state is not changed. The interpretation of subsequent bytes in the sequence is a function of the current escape state. - Bytes with all bits set to 0 should be placed in the escape state and interpreted as narrow characters. Bytes with all bits set to 0 should not appear as the first or subsequent bytes of a multi-byte character. For the source character set, the following conditions shall hold: Comments, string literals, character constants, or leading file names shall all begin and end in the initial escape state. - Comments, string literals, character constants, or leading file names shall all consist of legal multi-byte character sequences. 5.2.2 Character display semantics
Full position refers to the position on the display device where the next character output by the function "P" should appear, placing a printable (such as a character output by GB/T 15272) 94
The character display function defined by the function isurint displays the graphic representation of the character in the active position and then advances the active position to the next position in the current line. The writing direction is region-specific. If the active position is already at the last position in the line, the behavior is as specified.
indicates that the effect of executing the alphabetic escape sequence of the graphic character in the character set is to produce the following actions on the display device: a (warning) produces an audible or visual warning message. The active position should not be changed. 6. Backspace moves the active position to the previous position in the current line. If the active position is already at the beginning of the current line, the behavior is as specified,
(replace) moves the active position to the beginning of the next line (replace) moves the active position to the beginning of the next line Move the active bit to the start of the next line. (up) Move the active bit to the start of the current line. (down) Move the active bit to the next horizontal table position in the current line. If the active bit is already at or past the last horizontal table position defined, the behavior is unspecified. (down) Move the active bit to the start of the next vertical table position in the current line. If the active bit is already at or past the last vertical table position defined, the behavior is unspecified. Each of these escape sequences shall produce a unique value that can be stored in a single ch type object. Their external representation in the document need not be exactly the same as the internal representation and is beyond the scope of this standard. Pre-referenced clauses: function Iputc (clause 7.9.7.3), function isprint (clause 7.3.1. 7). 5.2.3 Signals and Interrupts
Interrupts shall be implemented so that they can be interrupted by a signal or called by a signal handler at any time, or both, and that they do not change the control flow of the earlier, still active caller, nor do they change the return value of the function or objects of automatic storage duration. All such objects shall be stored on a per-call basis outside the instructions represented by the execution of the function call.
Functions in libraries are not guaranteed to be reentrant, and they may modify objects of static storage duration. 5.2.4 Environmental Qualifications
Both the translation environment and the execution environment constrain the implementation of language translation programs and libraries. The following clause summarizes the qualifiers imposed by the environment on the implementation.
5.2.4.1 Detailed Qualifications
An implementation shall translate and execute at least one program, with at least one instance of each of the following qualifiers: An implementation shall avoid imposing certain qualifiers whenever possible. The nesting level of compound statements, loop blocks, and selection control structures is allowed to be 15 levels. The nesting level of conditionals is allowed to be 8. Pointer, array, and function declarators (which may be combined in any way) may modify arithmetic, constructs, unions, and incomplete types in declarations.
In a complete declarator, the nesting level of parenthesized declarators is allowed to be 31 levels. In a complete expression, the nesting level of parenthesized expressions is allowed to be 32 levels. The first 1 character of an internal identifier or macro name is significant. . The first 6 characters of an external identifier are valid. A translation unit can have 51 external identifiers. A block can have 127 declarative identifiers with mapping functions. A translation unit can have 1024 macro identifiers defined at the same time. A macro definition can have 1 formal parameter. A macro call can have 1 actual parameter.
\· A macro definition can have 31 formal parameters GB/T 1527294
A call can have 31 actual parameters.
A logical source line can have 509 characters. (After the link) A literal or string literal can have 509 characters. An image can occupy 32767 bytes (only for the host loop). A #include file can be nested 8 levels deep. 257 casc labels are allowed in a switch statement (not including case labels in a set of switch statements). A single structure or union is allowed to have 127 members. A single structure declaration table is allowed to have 15 levels of nested structure or union definitions. 5.2.4.2 Numerical Qualifications
All qualifiers specified in this clause shall be followed in the implementation documentation. These qualifiers shall be specified in the preamble.2 Character Display Semantics
The active position is the position on the display device where the next character to be output by the function "P" should appear, a printable character (such as defined by the GB/T 15272 94
function isurint) is placed in the active position, and then the active position is moved to the next position in the current line. The writing direction is region-specific. If the active position is already at the last position of the line, the behavior is as specified.
indicates that the role of the alphabetic escape sequence of the graphic character in the execution character set is to produce the following actions on the display device: a (warning) Produce an audible or visual warning message. The active position should not be changed. 6 "Backspace" Move the active position to the first position of the current line. If the active position is already at the beginning of the current line, the behavior is as specified,
(replace) Move the active position to the beginning of the next line (replace) Move the active position to the beginning of the next line Move the active bit to the start of the next line. (up) Move the active bit to the start of the current line. (down) Move the active bit to the next horizontal table position in the current line. If the active bit is already at or past the last horizontal table position defined, the behavior is unspecified. (down) Move the active bit to the start of the next vertical table position in the current line. If the active bit is already at or past the last vertical table position defined, the behavior is unspecified. Each of these escape sequences shall produce a unique value that can be stored in a single ch type object. Their external representation in the document need not be exactly the same as the internal representation and is beyond the scope of this standard. Pre-referenced clauses: function Iputc (clause 7.9.7.3), function isprint (clause 7.3.1. 7). 5.2.3 Signals and Interrupts
Interrupts shall be implemented so that they can be interrupted by a signal or called by a signal handler at any time, or both, and that they do not change the control flow of the earlier, still active caller, nor do they change the return value of the function or objects of automatic storage duration. All such objects shall be stored on a per-call basis outside the instructions represented by the execution of the function call.
Functions in libraries are not guaranteed to be reentrant, and they may modify objects of static storage duration. 5.2.4 Environmental Qualifications
Both the translation environment and the execution environment constrain the implementation of language translation programs and libraries. The following clause summarizes the qualifiers imposed by the environment on the implementation.
5.2.4.1 Detailed Qualifications
An implementation shall translate and execute at least one program, with at least one instance of each of the following qualifiers: An implementation shall avoid imposing certain qualifiers whenever possible. The nesting level of compound statements, loop blocks, and selection control structures is allowed to be 15 levels. The nesting level of conditionals is allowed to be 8. Pointer, array, and function declarators (which may be combined in any way) may modify arithmetic, constructs, unions, and incomplete types in declarations.
In a complete declarator, the nesting level of parenthesized declarators is allowed to be 31 levels. In a complete expression, the nesting level of parenthesized expressions is allowed to be 32 levels. The first 1 character of an internal identifier or macro name is significant. . The first 6 characters of an external identifier are valid. A translation unit can have 51 external identifiers. A block can have 127 declarative identifiers with mapping functions. A translation unit can have 1024 macro identifiers defined at the same time. A macro definition can have 1 formal parameter. A macro call can have 1 actual parameter.
\· A macro definition can have 31 formal parameters GB/T 1527294
A call can have 31 actual parameters.
A logical source line can have 509 characters. (After the link) A literal or string literal can have 509 characters. An image can occupy 32767 bytes (only for the host loop). A #include file can be nested 8 levels deep. 257 casc labels are allowed in a switch statement (not including case labels in a set of switch statements). A single structure or union is allowed to have 127 members. A single structure declaration table is allowed to have 15 levels of nested structure or union definitions. 5.2.4.2 Numerical Qualifications
All qualifiers specified in this clause shall be followed in the implementation documentation. These qualifiers shall be specified in the preamble.2 Character Display Semantics
The active position is the position on the display device where the next character to be output by the function "P" should appear, a printable character (such as defined by the GB/T 15272 94
function isurint) is placed in the active position, and then the active position is moved to the next position in the current line. The writing direction is region-specific. If the active position is already at the last position of the line, the behavior is as specified.
indicates that the role of the alphabetic escape sequence of the graphic character in the execution character set is to produce the following actions on the display device: a (warning) Produce an audible or visual warning message. The active position should not be changed. 6 "Backspace" Move the active position to the first position of the current line. If the active position is already at the beginning of the current line, the behavior is as specified,
(replace) Move the active position to the beginning of the next line (replace) Move the active position to the beginning of the next line Move the active bit to the start of the next line. (up) Move the active bit to the start of the current line. (down) Move the active bit to the next horizontal table position in the current line. If the active bit is already at or past the last horizontal table position defined, the behavior is unspecified. (down) Move the active bit to the start of the next vertical table position in the current line. If the active bit is already at or past the last vertical table position defined, the behavior is unspecified. Each of these escape sequences shall produce a unique value that can be stored in a single ch type object. Their external representation in the document need not be exactly the same as the internal representation and is beyond the scope of this standard. Pre-referenced clauses: function Iputc (clause 7.9.7.3), function isprint (clause 7.3.1. 7). 5.2.3 Signals and Interrupts
Interrupts shall be implemented so that they can be interrupted by a signal or called by a signal handler at any time, or both, and that they do not change the control flow of the earlier, still active caller, nor do they change the return value of the function or objects of automatic storage duration. All such objects shall be stored on a per-call basis outside the instructions represented by the execution of the function call.
Functions in libraries are not guaranteed to be reentrant, and they may modify objects of static storage duration. 5.2.4 Environmental Qualifications
Both the translation environment and the execution environment constrain the implementation of language translation programs and libraries. The following clause summarizes the qualifiers imposed by the environment on the implementation.
5.2.4.1 Detailed Qualifications
An implementation shall translate and execute at least one program, with at least one instance of each of the following qualifiers: An implementation shall avoid imposing certain qualifiers whenever possible. The nesting level of compound statements, loop blocks, and selection control structures is allowed to be 15 levels. The nesting level of conditionals is allowed to be 8. Pointer, array, and function declarators (which may be combined in any way) may modify arithmetic, constructs, unions, and incomplete types in declarations.
In a complete declarator, the nesting level of parenthesized declarators is allowed to be 31 levels. In a complete expression, the nesting level of parenthesized expressions is allowed to be 32 levels. The first 1 character of an internal identifier or macro name is significant. . The first 6 characters of an external identifier are valid. A translation unit can have 51 external identifiers. A block can have 127 declarative identifiers with mapping functions. A translation unit can have 1024 macro identifiers defined at the same time. A macro definition can have 1 formal parameter. A macro call can have 1 actual parameter.
\· A macro definition can have 31 formal parameters GB/T 1527294
A call can have 31 actual parameters.
A logical source line can have 509 characters. (After the link) A literal or string literal can have 509 characters. An image can occupy 32767 bytes (only for the host loop). A #include file can be nested 8 levels deep. 257 casc labels are allowed in a switch statement (not including case labels in a set of switch statements). A single structure or union is allowed to have 127 members. A single structure declaration table is allowed to have 15 levels of nested structure or union definitions. 5.2.4.2 Numerical Qualifications
All qualifiers specified in this clause shall be followed in the implementation documentation. These qualifiers shall be specified in the preamble.
Tip: This standard content only shows part of the intercepted content of the complete standard. If you need the complete standard, please go to the top to download the complete standard document for free.