[17258] in Kerberos_V5_Development

home help back first fref pref prev next nref lref last post

Re: [PATCH] Plugin Interface Change

daemon@ATHENA.MIT.EDU (Greg Hudson)
Wed Oct 5 23:54:55 2011

From: Greg Hudson <ghudson@mit.edu>
To: Will Fiveash <will.fiveash@oracle.com>
In-Reply-To: <20111005235438.GC28537@sun.com>
Date: Wed, 05 Oct 2011 23:54:49 -0400
Message-ID: <1317873289.2101.135.camel@t410>
Mime-Version: 1.0
Cc: "krbdev@mit.edu" <krbdev@mit.edu>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: krbdev-bounces@mit.edu

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.


_______________________________________________
krbdev mailing list             krbdev@mit.edu
https://mailman.mit.edu/mailman/listinfo/krbdev

home help back first fref pref prev next nref lref last post