Linguagem de Programação C - NORMA ISO/IEC 9899TC2

Linguagem de Programação C - NORMA ISO/IEC 9899TC2

(Parte 7 de 11)

1Theactive positionis that location on a display device where the next character output by thefputcfunction would appear.The intent of writing a printing character (as defined by theisprintfunction) to a display device is to display a graphic representation of that character at the active position and then advance the active position to the next position on the current line.The direction of writing is locale-specific.If the active position is at the final position of a line (if there is one), the behavior of the display device is unspecified.

2Alphabetic escape sequences representing nongraphic characters in the execution character 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)Movesthe active position to the previous position on the current line.If the active position is at the initial position of a line, the behavior of the display device is unspecified.

\f(form feed)Movesthe active position to the initial position at the start of the next logical page.

\n(newline)Movesthe active position to the initial position of the next line.

\r(carriage return)Movesthe active position to the initial position of the current line.

\t(horizontal tab)Movesthe active position to the next horizontal tabulation position on the current line.If the active position is at or past the last defined horizontal tabulation position, the behavior of the display device is unspecified.

\v(vertical tab)Movesthe active position to the initial position of the next vertical tabulation position.If the active position is at or past the last defined vertical tabulation position, the behavior of the display device is unspecified.

3Each of these escape sequences shall produce a unique implementation-defined value which can be stored in a singlecharobject. Theexternal representations in a text file need not be identical to the internal representations, and are outside the scope of this

§5.2.2 Environment 19

ISO/IEC 9899:TC2Committee Draft — May 6, 2005WG14/N1124

International Standard. Forward references:theisprintfunction (7.4.1.8), thefputcfunction (7.19.7.3).

5.2.3 Signalsand interrupts

1Functions shall be implemented such that theymay be interrupted at anytime by a signal, or may be called by a signal handler,orboth, with no alteration to earlier,but still active, invocations’ control flow(after the interruption), function return values, or objects with automatic storage duration.All such objects shall be maintained outside thefunction image(the instructions that compose the executable representation of a function) on a per-invocation basis.

5.2.4 Environmental limits

1Both the translation and execution environments constrain the implementation of language translators and libraries.The following summarizes the language-related environmental limits on a conforming implementation; the library-related limits are discussed in clause 7.

5.2.4.1 Translation limits

1The implementation shall be able to translate and execute at least one program that contains at least one instance of every one of the following limits:13)

—127 nesting levels of blocks

—12pointer,array,and function declarators (in anycombinations) modifying an arithmetic, structure, union, or incomplete type in a declaration

—63nesting levels of parenthesized expressions within a full expression

—63significant initial characters in an internal identifier or a macro name (each universal character name or extended source character is considered a single character)

—31significant initial characters in an external identifier (each universal character name specifying a short identifier of 0F or less is considered 6 characters, each universal character name specifying a short identifier of 00010000 or more is considered 10 characters, and each extended source character is considered the same number of characters as the corresponding universal character name, if any)14)

13)Implementations should avoid imposing fixed translation limits wheneverpossible. 14)See ‘‘future language directions’’(6.1.3).

20 Environment §5.2.4.1

WG14/N1124 CommitteeDraft — May 6, 2005ISO/IEC 9899:TC2

—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)

—15nesting levels for#includedfiles

—1023caselabels for aswitchstatement (excluding those for anynestedswitch statements)

—1023 members in a single structure or union

—1023 enumeration constants in a single enumeration

—63lev els of nested structure or union definitions in a single struct-declaration-list 5.2.4.2 Numerical limits

1An 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 are specified in <stdint.h>.

Forward references: integer types <stdint.h> (7.18). 5.2.4.2.1 Sizesof integer types<limits.h>

1The values givenbelowshall be replaced by constant expressions suitable for use in#if preprocessing directives. Moreover, except forCHAR_BITandMB_LEN_MAX,the following shall be replaced by expressions that have the same type as would an expression that is an object of the corresponding type converted according to the integer promotions. Theirimplementation-defined values shall be equal or greater in magnitude (absolute value) to those shown, with the same sign.

—number of bits for smallest object that is not a bit-field (byte) CHAR_BIT 8

§5.2.4.2.1 Environment 21

ISO/IEC 9899:TC2Committee Draft — May 6, 2005WG14/N1124

—minimum value for an object of typechar CHAR_MINsee below

—maximum value for an object of typechar CHAR_MAXsee below

—maximum number of bytes in a multibyte character,for anysupported locale MB_LEN_MAX 1

(Parte 7 de 11)

Comentários