I do not understand why C style callbacks are not type safe. A
callback function must match the function pointer signature specified
in the callee. If the signatures are compared at compile time, how is
this not type safe? I understand that a function pointer is just an
address but if the compiler is capable of checking the use of the
callback I don't see how it could not be type safe. Please explain
and provide examples. Thanks!
callback function must match the function pointer signature specified
in the callee. If the signatures are compared at compile time, how is
this not type safe? I understand that a function pointer is just an
address but if the compiler is capable of checking the use of the
callback I don't see how it could not be type safe. Please explain
and provide examples. Thanks!
Last edited by a moderator: