Стандарт языка Си С99 TC (1113411), страница 35
Текст из файла (страница 35)
Any other predefined macro namesshall begin with a leading underscore followed by an uppercase letter or a secondunderscore.5The implementation shall not predefine the macro _ _cplusplus, nor shall it define itin any standard header.Forward references: the asctime function (7.23.3.1), standard headers (7.1.2).6.10.9 Pragma operatorSemantics1A unary operator expression of the form:_Pragma ( string-literal )is processed as follows: The string literal is destringized by deleting the L prefix, ifpresent, deleting the leading and trailing double-quotes, replacing each escape sequence\" by a double-quote, and replacing each escape sequence \\ by a single backslash.
Theresulting sequence of characters is processed through translation phase 3 to producepreprocessing tokens that are executed as if they were the pp-tokens in a pragmadirective. The original four preprocessing tokens in the unary operator expression areremoved.2EXAMPLEA directive of the form:#pragma listing on "..\listing.dir"can also be expressed as:§6.10.9Language161ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256_Pragma ( "listing on \"..\\listing.dir\"" )The latter form is processed in the same way whether it appears literally as shown, or results from macroreplacement, as in:#define LISTING(x) PRAGMA(listing on #x)#define PRAGMA(x) _Pragma(#x)LISTING ( ..\listing.dir )162Language§6.10.9WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC36.11 Future language directions6.11.1 Floating types1Future standardization may include additional floating-point types, including those withgreater range, precision, or both than long double.6.11.2 Linkages of identifiers1Declaring an identifier with internal linkage at file scope without the static storageclass specifier is an obsolescent feature.6.11.3 External names1Restriction of the significance of an external name to fewer than 255 characters(considering each universal character name or extended source character as a singlecharacter) is an obsolescent feature that is a concession to existing implementations.6.11.4 Character escape sequences1Lowercase letters as escape sequences are reserved for future standardization.
Othercharacters may be used in extensions.6.11.5 Storage-class specifiers1The placement of a storage-class specifier other than at the beginning of the declarationspecifiers in a declaration is an obsolescent feature.6.11.6 Function declarators1The use of function declarators with empty parentheses (not prototype-format parametertype declarators) is an obsolescent feature.6.11.7 Function definitions1The use of function definitions with separate parameter identifier and declaration lists(not prototype-format parameter type and identifier declarators) is an obsolescent feature.6.11.8 Pragma directives1Pragmas whose first preprocessing token is STDC are reserved for future standardization.6.11.9 Predefined macro names1Macro names beginning with _ _STDC_ are reserved for future standardization.§6.11.9Language163ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12567.
Library7.1 Introduction7.1.1 Definitions of terms1A string is a contiguous sequence of characters terminated by and including the first nullcharacter. The term multibyte string is sometimes used instead to emphasize specialprocessing given to multibyte characters contained in the string or to avoid confusionwith a wide string. A pointer to a string is a pointer to its initial (lowest addressed)character.
The length of a string is the number of bytes preceding the null character andthe value of a string is the sequence of the values of the contained characters, in order.2The decimal-point character is the character used by functions that convert floating-pointnumbers to or from character sequences to denote the beginning of the fractional part ofsuch character sequences.157) It is represented in the text and examples by a period, butmay be changed by the setlocale function.3A null wide character is a wide character with code value zero.4A wide string is a contiguous sequence of wide characters terminated by and includingthe first null wide character. A pointer to a wide string is a pointer to its initial (lowestaddressed) wide character.
The length of a wide string is the number of wide characterspreceding the null wide character and the value of a wide string is the sequence of codevalues of the contained wide characters, in order.5A shift sequence is a contiguous sequence of bytes within a multibyte string that(potentially) causes a change in shift state (see 5.2.1.2). A shift sequence shall not have acorresponding wide character; it is instead taken to be an adjunct to an adjacent multibytecharacter.158)Forward references: character handling (7.4), the setlocale function (7.11.1.1).157) The functions that make use of the decimal-point character are the numeric conversion functions(7.20.1, 7.24.4.1) and the formatted input/output functions (7.19.6, 7.24.2).158) For state-dependent encodings, the values for MB_CUR_MAX and MB_LEN_MAX shall thus be largeenough to count all the bytes in any complete multibyte character plus at least one adjacent shiftsequence of maximum length. Whether these counts provide for more than one shift sequence is theimplementation’s choice.164Library§7.1.1WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC37.1.2 Standard headers1Each library function is declared, with a type that includes a prototype, in a header,159)whose contents are made available by the #include preprocessing directive.
Theheader declares a set of related functions, plus any necessary types and additional macrosneeded to facilitate their use. Declarations of types described in this clause shall notinclude type qualifiers, unless explicitly stated otherwise.2The standard headers are<assert.h><complex.h><ctype.h><errno.h><fenv.h><float.h><inttypes.h><iso646.h><limits.h><locale.h><math.h><setjmp.h><signal.h><stdarg.h><stdbool.h><stddef.h><stdint.h><stdio.h><stdlib.h><string.h><tgmath.h><time.h><wchar.h><wctype.h>3If a file with the same name as one of the above < and > delimited sequences, notprovided as part of the implementation, is placed in any of the standard places that aresearched for included source files, the behavior is undefined.4Standard headers may be included in any order; each may be included more than once ina given scope, with no effect different from being included only once, except that theeffect of including <assert.h> depends on the definition of NDEBUG (see 7.2).
Ifused, a header shall be included outside of any external declaration or definition, and itshall first be included before the first reference to any of the functions or objects itdeclares, or to any of the types or macros it defines. However, if an identifier is declaredor defined in more than one header, the second and subsequent associated headers may beincluded after the initial reference to the identifier. The program shall not have anymacros with names lexically identical to keywords currently defined prior to theinclusion.5Any definition of an object-like macro described in this clause shall expand to code that isfully protected by parentheses where necessary, so that it groups in an arbitraryexpression as if it were a single identifier.6Any declaration of a library function shall have external linkage.7A summary of the contents of the standard headers is given in annex B.Forward references: diagnostics (7.2).159) A header is not necessarily a source file, nor are the < and > delimited sequences in header namesnecessarily valid source file names.§7.1.2Library165ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12567.1.3 Reserved identifiers1Each header declares or defines all identifiers listed in its associated subclause, andoptionally declares or defines identifiers listed in its associated future library directionssubclause and identifiers which are always reserved either for any use or for use as filescope identifiers.— All identifiers that begin with an underscore and either an uppercase letter or anotherunderscore are always reserved for any use.— All identifiers that begin with an underscore are always reserved for use as identifierswith file scope in both the ordinary and tag name spaces.— Each macro name in any of the following subclauses (including the future librarydirections) is reserved for use as specified if any of its associated headers is included;unless explicitly stated otherwise (see 7.1.4).— All identifiers with external linkage in any of the following subclauses (including thefuture library directions) are always reserved for use as identifiers with externallinkage.160)— Each identifier with file scope listed in any of the following subclauses (including thefuture library directions) is reserved for use as a macro name and as an identifier withfile scope in the same name space if any of its associated headers is included.2No other identifiers are reserved.
If the program declares or defines an identifier in acontext in which it is reserved (other than as allowed by 7.1.4), or defines a reservedidentifier as a macro name, the behavior is undefined.3If the program removes (with #undef) any macro definition of an identifier in the firstgroup listed above, the behavior is undefined.7.1.4 Use of library functions1Each of the following statements applies unless explicitly stated otherwise in the detaileddescriptions that follow: If an argument to a function has an invalid value (such as a valueoutside the domain of the function, or a pointer outside the address space of the program,or a null pointer, or a pointer to non-modifiable storage when the correspondingparameter is not const-qualified) or a type (after promotion) not expected by a functionwith variable number of arguments, the behavior is undefined. If a function argument isdescribed as being an array, the pointer actually passed to the function shall have a valuesuch that all address computations and accesses to objects (that would be valid if thepointer did point to the first element of such an array) are in fact valid.
Any functiondeclared in a header may be additionally implemented as a function-like macro defined in160) The list of reserved identifiers with external linkage includes errno, math_errhandling,setjmp, and va_end.166Library§7.1.4WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC3the header, so if a library function is declared explicitly when its header is included, oneof the techniques shown below can be used to ensure the declaration is not affected bysuch a macro. Any macro definition of a function can be suppressed locally by enclosingthe name of the function in parentheses, because the name is then not followed by the leftparenthesis that indicates expansion of a macro function name.