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

Marcus Watts mdw at umich.edu
Wed Jul 26 03:25:11 EDT 2006


Nicolas Williams <Nicolas.Williams at sun.com> writes:
...
> You may not want to declare the partial structs.
> 
> The difference between this:
> 
> struct gss_name_struct;
> typedef struct gss_name_struct * gss_name_t;
> 
> and this:
> 
> typedef struct gss_name_struct * gss_name_t;
> 
> is that with the former you can't provide an actual definition for
> gss_name_struct in libgss, but with the latter you can.  This in turn
> saves the need for automatic variables and casting.
> 
> I know.  Sun did the former.  But we might fix that...

Are you saying this shouldn't work:
	/* x.c */
	struct gss_name_struct;
	typedef struct gss_name_struct * gss_name_t;

	struct gss_name_struct {
		int x;
		char *y;
	} foo[1];

and if so, what compiler???

As far as I know, the two forms you gave above should be completely
interchangeable.  The 2nd form you gave should[*] have exactly the same
effect on the compiler as the first form except for being slightly shorter.
	[*] "imho", or assumes sane C compiler & standard(s)

				-Marcus Watts



More information about the krbdev mailing list