[PATCH] Plugin Interface Change
ghudson at MIT.EDU
Wed Oct 5 23:54:49 EDT 2011
On Wed, 2011-10-05 at 19:54 -0400, Will Fiveash wrote:
> As an aside, having dealt with bugs related to the fact that void *
> essentially disables C type checking wouldn't it be better to use a
> incomplete struct pointer typedef?
We use incomplete structs a lot lately when it's simply a matter of
hiding a type between one module and another, but I don't want to impose
that as a requirement for every kind of opaque callback handle.
In a case liike this, a responder function might be used with different
argument types by different callers of the async function (even within
the same file). You can still manage that with casts, but (a) I've
noticed that programmers tend to find that a bit counterintuitive, and
(b) the gain in type safety is pretty marginal. The callback handle is
generally tightly wound up with the callback function, minimizing the
likelihood of error on the callback-invocation side.
More information about the krbdev