Стандарт языка Си С99 TC (1113411), страница 7
Текст из файла (страница 7)
While in the initial shift state, all single-byte characters retain their usualinterpretation and do not alter the shift state. The interpretation for subsequent bytesin the sequence is a function of the current shift state.— A byte with all bits zero shall be interpreted as a null character independent of shiftstate. Such a byte shall not occur as part of any other multibyte character.2For source files, the following shall hold:— An identifier, comment, string literal, character constant, or header name shall beginand end in the initial shift state.— An identifier, comment, string literal, character constant, or header name shall consistof a sequence of valid multibyte characters.5.2.2 Character display semantics1The active position is that location on a display device where the next character output bythe fputc function would appear.
The intent of writing a printing character (as definedby the isprint function) to a display device is to display a graphic representation ofthat character at the active position and then advance the active position to the nextposition on the current line.
The direction of writing is locale-specific. If the activeposition is at the final position of a line (if there is one), the behavior of the display deviceis unspecified.2Alphabetic escape sequences representing nongraphic characters in the executioncharacter set are intended to produce actions on display devices as follows:\a (alert) Produces an audible or visible alert without changing the active position.\b (backspace) Moves the active position to the previous position on the current line. Ifthe active position is at the initial position of a line, the behavior of the displaydevice is unspecified.\f ( form feed) Moves the active position to the initial position at the start of the nextlogical page.\n (new line) Moves the active position to the initial position of the next line.\r (carriage return) Moves the active position to the initial position of the current line.\t (horizontal tab) Moves the active position to the next horizontal tabulation positionon the current line.
If the active position is at or past the last defined horizontaltabulation position, the behavior of the display device is unspecified.\v (vertical tab) Moves the active position to the initial position of the next verticaltabulation position. If the active position is at or past the last defined vertical§5.2.2Environment19ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256tabulation position, the behavior of the display device is unspecified.3Each of these escape sequences shall produce a unique implementation-defined valuewhich can be stored in a single char object. The external representations in a text fileneed not be identical to the internal representations, and are outside the scope of thisInternational Standard.Forward references: the isprint function (7.4.1.8), the fputc function (7.19.7.3).5.2.3 Signals and interrupts1Functions shall be implemented such that they may be interrupted at any time by a signal,or may be called by a signal handler, or both, with no alteration to earlier, but still active,invocations’ control flow (after the interruption), function return values, or objects withautomatic storage duration.
All such objects shall be maintained outside the functionimage (the instructions that compose the executable representation of a function) on aper-invocation basis.5.2.4 Environmental limits1Both the translation and execution environments constrain the implementation oflanguage translators and libraries. The following summarizes the language-relatedenvironmental limits on a conforming implementation; the library-related limits arediscussed in clause 7.5.2.4.1 Translation limits1The implementation shall be able to translate and execute at least one program thatcontains at least one instance of every one of the following limits:13)— 127 nesting levels of blocks— 63 nesting levels of conditional inclusion— 12 pointer, array, and function declarators (in any combinations) modifying anarithmetic, structure, union, or incomplete type in a declaration— 63 nesting levels of parenthesized declarators within a full declarator— 63 nesting levels of parenthesized expressions within a full expression— 63 significant initial characters in an internal identifier or a macro name (eachuniversal character name or extended source character is considered a singlecharacter)— 31 significant initial characters in an external identifier (each universal character namespecifying a short identifier of 0000FFFF or less is considered 6 characters, each13) Implementations should avoid imposing fixed translation limits whenever possible.20Environment§5.2.4.1WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC3universal character name specifying a short identifier of 00010000 or more isconsidered 10 characters, and each extended source character is considered the samenumber of characters as the corresponding universal character name, if any)14)— 4095 external identifiers in one translation unit— 511 identifiers with block scope declared in one block— 4095 macro identifiers simultaneously defined in one preprocessing translation unit— 127 parameters in one function definition— 127 arguments in one function call— 127 parameters in one macro definition— 127 arguments in one macro invocation— 4095 characters in a logical source line— 4095 characters in a character string literal or wide string literal (after concatenation)— 65535 bytes in an object (in a hosted environment only)— 15 nesting levels for #included files— 1023 case labels for a switch statement (excluding those for any nested switchstatements)— 1023 members in a single structure or union— 1023 enumeration constants in a single enumeration— 63 levels of nested structure or union definitions in a single struct-declaration-list5.2.4.2 Numerical limits1An implementation is required to document all the limits specified in this subclause,which are specified in the headers <limits.h> and <float.h>.
Additional limits arespecified in <stdint.h>.Forward references: integer types <stdint.h> (7.18).5.2.4.2.1 Sizes of integer types <limits.h>1The values given below shall be replaced by constant expressions suitable for use in #ifpreprocessing directives. Moreover, except for CHAR_BIT and MB_LEN_MAX, thefollowing shall be replaced by expressions that have the same type as would anexpression that is an object of the corresponding type converted according to the integerpromotions. Their implementation-defined values shall be equal or greater in magnitude14) See ‘‘future language directions’’ (6.11.3).§5.2.4.2.1Environment21ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256(absolute value) to those shown, with the same sign.— number of bits for smallest object that is not a bit-field (byte)CHAR_BIT8— minimum value for an object of type signed charSCHAR_MIN-127 // −(27 − 1)— maximum value for an object of type signed charSCHAR_MAX+127 // 27 − 1— maximum value for an object of type unsigned charUCHAR_MAX255 // 28 − 1— minimum value for an object of type charCHAR_MINsee below— maximum value for an object of type charCHAR_MAXsee below— maximum number of bytes in a multibyte character, for any supported localeMB_LEN_MAX1— minimum value for an object of type short intSHRT_MIN-32767 // −(215 − 1)— maximum value for an object of type short intSHRT_MAX+32767 // 215 − 1— maximum value for an object of type unsigned short intUSHRT_MAX65535 // 216 − 1— minimum value for an object of type intINT_MIN-32767 // −(215 − 1)— maximum value for an object of type intINT_MAX+32767 // 215 − 1— maximum value for an object of type unsigned intUINT_MAX65535 // 216 − 1— minimum value for an object of type long intLONG_MIN-2147483647 // −(231 − 1)— maximum value for an object of type long intLONG_MAX+2147483647 // 231 − 1— maximum value for an object of type unsigned long intULONG_MAX4294967295 // 232 − 122Environment§5.2.4.2.1WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC3— minimum value for an object of type long long intLLONG_MIN-9223372036854775807 // −(263 − 1)— maximum value for an object of type long long intLLONG_MAX+9223372036854775807 // 263 − 1— maximum value for an object of type unsigned long long intULLONG_MAX18446744073709551615 // 264 − 12If the value of an object of type char is treated as a signed integer when used in anexpression, the value of CHAR_MIN shall be the same as that of SCHAR_MIN and thevalue of CHAR_MAX shall be the same as that of SCHAR_MAX.
Otherwise, the value ofCHAR_MIN shall be 0 and the value of CHAR_MAX shall be the same as that ofUCHAR_MAX.15) The value UCHAR_MAX shall equal 2CHAR_BIT − 1.Forward references: representations of types (6.2.6), conditional inclusion (6.10.1).5.2.4.2.2 Characteristics of floating types <float.h>1The characteristics of floating types are defined in terms of a model that describes arepresentation of floating-point numbers and values that provide information about animplementation’s floating-point arithmetic.16) The following parameters are used todefine the model for each floating-point type:sbepfk2A floating-point number (x) is defined by the following model:x = sb e3sign (±1)base or radix of exponent representation (an integer > 1)exponent (an integer between a minimum emin and a maximum emax )precision (the number of base-b digits in the significand)nonnegative integers less than b (the significand digits)pf k b−k ,Σk=1emin ≤ e ≤ emaxIn addition to normalized floating-point numbers ( f 1 > 0 if x ≠ 0), floating types may beable to contain other kinds of floating-point numbers, such as subnormal floating-pointnumbers (x ≠ 0, e = emin , f 1 = 0) and unnormalized floating-point numbers (x ≠ 0,e > emin , f 1 = 0), and values that are not floating-point numbers, such as infinities andNaNs.