Defect Report #084
Submission Date: 03 Dec 93
Submittor: WG14
Source: Clive Feather
Question
Item 21 - incomplete type in function declaration
Consider the following declarations:
struct tag;
extern void (*f) (struct tag);
At the point of the declaration of f,
the type of the parameter
is incomplete. Now a parameter is an object (subclause 3.15) with
no linkage (subclause 6.1.2.2), but it is unclear whether this is
a declaration of the parameter. If it is, then the declaration of
f is forbidden by subclause 6.5. If it is not, then the declaration
is strictly conforming. Which is the case?
If the type struct tag is completed before a call to f,
is the call strictly conforming? Alternatively, since the declaration
of f includes an incomplete type,
is it possible to make a call
to it at all?
Response
From subclause 6.5.2.3, the incomplete type specified by the
tag may be used, unless the size of the corresponding object
is needed.
In responding to Defect Reports, the Committee has discussed at
length when the size of an object is actually required. The C
Standard is inconclusive with regard to whether or not the size
of the structure is needed in the example given, leaving the
behavior undefined.
The Committee should revisit this issue during the revision of the
C Standard.
Previous Defect Report
< - >
Next Defect Report