Required Declaration of C Function Parameters
gwyn at BRL-VLD.ARPA
gwyn at BRL-VLD.ARPA
Tue Jul 31 23:43:08 AEST 1984
From: Doug Gwyn (VLD/VMB) <gwyn at BRL-VLD.ARPA>
That is a good point you raise. For clarity, consider the example:
typedef <stuff> t_func;
extern t_func func( t_func (*)(), int, char * );
Note the empty parentheses in the first parameter specification.
This is one case in which the "unspecified parameters" use of `()'
appears to be essential. Note also that the value type `t_func'
must have been previously defined.
I think the key is that the type of the function `func' is just its
value type and the fact that it is a function, i.e. `t_func ()',
and the types of the parameters are not part of its formal type
although it is required that the parameter types be given in the
function declaration. This is an important distinction that solves
the problem of recursive types.
More information about the Comp.lang.c
mailing list