Defect Report #009
Submission Date: 10 Dec 92
Source: X3J11/90-023 (Bruce Blodgett)
Use of typedef names in parameter declarations
A syntactic ambiguity exists in the draft proposed C standard for
which there appears to be no semantic disambiguation. A sequence of
examples should explain the ambiguity. This matter needs interpretation
by the Committee.
For these examples, let T be declaration
specifiers which contai n at least one type specifier, to satisfy the
semantics from subclause 6.5.6:
If the identifier is redeclared in an inner scope ...,
the type specifiers shall not be omitted in the inner declaration.
Let U be an identifier which is a
typedef name at outer scope and which has not (yet) been redeclared at
current scope. A caret indicates the position of each abstract
declarator. Consider this declaration:
declaration-specifiers direct-declarator (T^(U));
Here U is the type of the single parameter to a
function returni ng type T, due to a requirement from
In a parameter declaration, a single typedef name in
parentheses is taken to be an abstract declarator that specifies a
function with a single parameter, not as redundant parentheses around
the identifier for a declarator.
Consider this declaration:
In this example, U could be the type returned
by a function which takes parameter-type-list. This in
turn would be the single parameter to a function returning type T.
Alternatively, U could be a redundantly
parenthesized name of a function which takes parameter-type-list
and returns type
Given the spirit of the requirement from subclause 18.104.22.168, the
former interpretation seems to be that intended by the Committee. If so,
the requirement may be changed to something similar to:
In a parameter declaration, a direct declarator which
redeclares a typedef name shall not be redundantly parenthesized.
Of course, parentheses must not be disallowed entirely...
[The original had more, but this will suffice.]
In subclause 22.214.171.124, page 68, lines 2-4, replace:
In a parameter declaration, a single typedef name in parentheses
is taken to be an abstract declarator that specifies a function with a
single parameter, not as redundant parentheses around the identifier for
If, in a parameter declaration, an identifier can be treated as a
typedef name or as a parameter name, it shall be taken as a typedef
Previous Defect Report
< - > Next Defect Report