Submitter: UK C Panel
Submission Date: 2001-09-07
Source: Clive D.W. Feather <firstname.lastname@example.org>
Subject: incomplete argument types when calling non-prototyped functions
Consider the code:
void jim (); void sheila (void); // ... sheila (jim ()); /* Line A */ jim (sheila ()); /* Line B */
Line A violates the constraint of 126.96.36.199#2, that requires the argument to have a type that can be assigned to the parameter type. But line B doesn't because that constraint only applies to prototyped functions. 188.8.131.52#4 reads in part:
[#4] An argument may be an expression of any object type.
but this is not a constraint. Should it not be ? After all, the compiler has to know the type of the argument in order to compile the function call, so it can check at that point that the argument has a complete object type.
Suggested Technical Corrigendum
Add a new paragraph #1a following 184.108.40.206#1:
[#1a] Each argument shall have a type which is a completed object type.
This should not be a constraint.
Previous Defect Report < - > Next Defect Report