C language international standard ISOIEC 9899: 1999 (E) Translation (E) Translation (E)

zhaozj2021-02-16  56

C language international standard ISO / IEC 9899: 1999 (E) Translation (E) Translation (E)

BY RIVERTIME

Library

7.1.2 Standard header file

1 Declare each library function, including its prototype, header file. [Note 153: The header file does not have to be a source file, and the character sequence between '<' and '>' in the header file name is not necessarily the legal source name] The content of the header file is supplied by the #include pre-processing. The header file declares a correlation function set, the necessary type and macro definition. The types described in this clause should not include type limits unless otherwise specified.

2 The standard header file is as follows:

3 If a file is defined as part of the '<' and '>' mentioned above, it is not provided with any standard for the implementation of the implementation, which is not defined.

4 Standard header files can be included in any order; each header file can be included more than once, with only one effect containing only once, but it contains files that depend on nDebug definitions. (See 7.2). The header file should be included in any external statement or definition, and should also be included before any function or object it declares, any type or macro defined before the first reference is included. However, if the identifier is declared or defined in more than one header file, the second and future related header files allow the identifier to be included after the initial reference of the identifier. The program should not have any macro name and the same keyword containing the previously defined.

5 Any macro of any similar macro described in this clause should be expanded to be fully protected by the parentheses so that it is a single identifier in any of the expressions.

The 6 library function should have a corresponding external link.

7 Summary of the standard header file content is given in Appendix B. For further reference: Diagnostics (7.2).

7.1.3 Reserved identifier

1 Each header file declares or defines all identifiers listed in its related subtrips, while selectively declaring or defining all identifiers listed in the sub-clause of the sub-clause of the library, and those either Is the identifier that is always reserved for any other use or for the identifier within the file range.

- All of the following scribings and the identifiers starting with a capital letter or another underscore are always reserved.

- All of the following underscore starting identifiers are always reserved, file scope identifiers for ordinary and label namespaces.

- Retaining each macro name in any of the following subsistencements (including future library directions) is included to specify whether any header files are included; unless otherwise clear (see 7.1.4).

- All identifiers in any of the following subtails (including future library directions) are always reserved, used as an identifier for an external link. [Note 154: The retention identifier of external links includes Error, setjmp, and va_end. 】

- Reserved for each file scope listed in any subtellips (including future library directions), for macro names, and also used for file scope identifiers in the same namespace. If its corresponding one of the files is included.

2 The other identifiers are not retained. If the program declares or defines an identifier (different from the subsequent 7.1.4) in a context, or defines a retention identifier as a macro name, its behavior is not defined.

3 If a program deletes (through #undef) The behavior is not defined by any macro definition of the identifier listed above.

7.1.4 Use of library functions

1 The following statements are applied, unless otherwise stated in detail in detail: If the parameter value of the transmitted function is not legal (for example, the value outside the function of the function, or the pointer is outside the address space of the program , Or empty pointer, or pointer points to the non-written memory, the corresponding parameters are not constant as a constant), or a type (upward conversion) does not meet the definition of the number of variable parameters, this behavior is not defined. If the function parameter is described as an array, the pointer to the actual transmit function should be a value of an address calculation and access object (if the pointer is really pointing to the first element of the array, it is legal). Any function defined in the header file may be re-implemented again in the macro defined in the header file, so if the library function is explicitly declared by including the header file, one of the following technologies can be used to ensure that the statement is not such a macro. Impact. Any macro definition of the function can be partially prohibited by homing a function name with inclockets, because the name will no longer follow the left brackets indicating the macro function. Similarly, the address that allows the library function is allowed even if it is also defined as a macro. [Note 155] Use the #undef mask macro to ensure that the actual function is notified. Any call to the library function of the macro implementation should be expanded to only one code for each parameter, and the cracker is protected by parentheses when needed, so using any expression is usually safe [Note 156]. Similarly, the macros described in the following subtrips can be called in the expression, wherever there is a match with unanimous return types, can be called [Note 157]. All listed unfolded integration of constant constant expression objects should apply in the #IF pre-processing instruction.

2 If the library function declares does not reference the type defined in a header file, it is allowed to declare and use the function that does not contain its corresponding header file.

3 There is a sequence point before the library function returns.

4 Do not guarantee the standard library function is reusable, it may modify the objects in the static storage domain. [Note 158]

[Note 155] This means that an implementation should provide an actual function for each library function, although it

Also providing a macro for this function.

[Note 156] This macro may not include order points, and its corresponding function calls are included.

[Note 157] Because the external identifier and some macro names starting with the following lines are reserved, the implementation can

Provide special semantics for these names. For example, identifier _BUILTIN_ABS can be used to indicate ABS functions

The generation of the inline code. Therefore, the appropriate header file can be specified for the compiler.

#define abs (x) _builtin_abs (x)

The code generator of the compiler will receive it. According to this, if the user wants to ensure that the library function like ABS is a real function to write:

#undef abs

Regardless of the implementation of the header file to provide ABS macro implementation or built-in implementation. The prototypes that are defined in advance and hidden in advance and hidden are therefore exposed.

[Note 158] Therefore, a signal handler usually does not call the standard library function. 5 cases

Function ATOI can have the following usage:

- With its corresponding header file (very likely to generate a macro expression)

#include

Const char * STR;

/ * ... * /

i = ATOI (STR);

- Use their corresponding header file (must be generated to generate a real function reference)

#include

#undef atoi

Const char * STR;

/ * ... * /

i = ATOI (STR);

or

#include

Const char * STR;

/ * ... * /

I = (atoi) (STR);

- Clearly state

Extern Int Atoi; Const CHAR *);

Const char * STR;

/ * ... * /

i = ATOI (STR);

[This part is over]

转载请注明原文地址:https://www.9cbs.com/read-23025.html

New Post(0)