[krbdev.mit.edu #4057] GSSAPI opaque types should be pointers to opaque structs, not void*

Tom Yu tlyu at MIT.EDU
Wed Jul 26 14:27:55 EDT 2006

>>>>> "nico" == Nicolas Williams <Nicolas.Williams at sun.com> writes:

nico> You may not want to declare the partial structs.
nico> The difference between this:

nico> struct gss_name_struct;
nico> typedef struct gss_name_struct * gss_name_t;

nico> and this:

nico> typedef struct gss_name_struct * gss_name_t;

nico> is that with the former you can't provide an actual definition for
nico> gss_name_struct in libgss, but with the latter you can.  This in turn
nico> saves the need for automatic variables and casting.

Given my readings of c99, the two forms above are equivalent.  Both
declare a struct tag named "gss_name_struct"; the struct type is an
incomplete type unless a declaration defining the contents of the
struct appears in that scope.

You may be thinking of the quirk that declaring

struct gss_name_struct;

in an inner scope where struct gss_name_struct has been declared in an
outer scope declares a different type than that specified in the outer
scope, but that shouldn't be relevant for anyone who isn't doing
strange things such as including gssapi.h within a block.


More information about the krbdev mailing list