as jdehaan wrote typedef void * functions (literary ignore/don't use a result) indicates the same as a Pascal procedure, and although there are pascal modes that can ignore a Pascal function result, so in fact like a procedure, this is not quite the same: such code still assigns a result because the compiler can not know if another call uses the result and therefor a procedure is more efficient in such case. C works the same in the case of void * function.. it is C's haphazard notation for procedure..
jamie's answer is not correct. jdehaan's answer is correct.
It is all about the generated assembler and you can easily verify that.
And Please explain to me where I am incorrect?
You are a piece of work Thaddy in your own mind!
Thaddy is right however. The declaration that
jiaxing2 posted is essentially parsed like this:
typedef void (*my_annoying_c_function)(size_t sz);
The correct translation of a C function having
void as result type
is to use a
procedure. If you'd use a function the compiler would need to discard the result value (in most cases that is simply a register, but that doesn't have to be the case on all platforms) while for a procedure it doesn't need to do that, because it knows that there isn't one. Also if you'd implement a function that you'd assign to such a function variable you'd have do deal with
Result while it wouldn't require one.
Then how to translate
typedef void my_annoying_c_function(size_t sz);
In the end those are used like this:
my_annoying_c_function *func;
Thus you translate them just as if they were a normal function pointer, because Pascal doesn't have that distinction.