6.7.5 Declarators

Previous Table of Contents "New C Standard" commentary

1547

declarator:
                pointeropt direct-declarator

direct-declarator: identifier ( declarator ) direct-declarator [ type-qualifier-listopt assignment-expressionopt ] direct-declarator [ static type-qualifier-listopt assignment-expression ] direct-declarator [ type-qualifier-list static assignment-expression ] direct-declarator [ type-qualifier-listopt * ] direct-declarator ( parameter-type-list ) direct-declarator ( identifier-listopt )

pointer: * type-qualifier-listopt * type-qualifier-listopt pointer

type-qualifier-list: type-qualifier type-qualifier-list type-qualifier

parameter-type-list: parameter-list parameter-list , ...

parameter-list: parameter-declaration parameter-list , parameter-declaration

parameter-declaration: declaration-specifiers declarator declaration-specifiers abstract-declaratoropt

identifier-list: identifier identifier-list , identifier

1548 Each declarator declares one identifier, and asserts that when an operand of the same form as the declarator appears in an expression, it designates a function or object with the scope, storage duration, and type indicated by the declaration specifiers.

1549 A full declarator is a declarator that is not part of another declarator.

1550 The end of a full declarator is a sequence point.

1551 If in the nested sequence of declarators in a full declarator contains there is a declarator specifying a variable length array type, the type specified by the full declarator is said to be variably modified.

1552 Furthermore, any type derived by declarator type derivation from a variably modified type is itself variably modified.

1553 In the following subclauses, consider a declaration

        T D1

where T contains the declaration specifiers that specify a type T (such as int) and D1 is a declarator that contains an identifier ident.

1554 The type specified for the identifier ident in the various forms of declarator is described inductively using this notation.

1555 If, in the declaration “T D1”, D1 has the form

        identifier

then the type specified for ident is T.

1556 If, in the declaration “T D1”, D1 has the form

        ( D )

then ident has the type specified by the declaration “T D”.

1557 Thus, a declarator in parentheses is identical to the unparenthesized declarator, but the binding of complicated declarators may be altered by parentheses.

1558 As discussed in 5.2.4.1, an implementation may limit the number of pointer, array, and function declarators that modify an arithmetic, structure, union, or incomplete type, either directly or via one or more typedefs.

1559 Forward references: array declarators (6.7.5.2), type definitions (6.7.7).

Next

Created at: 2008-01-30 02:39:43 The text from WG14/N1256 is copyright © ISO