unsafe typedefs?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

unsafe typedefs?

Will Fiveash
In the latest MIT src/include/krb5.h I see:

typedef void * krb5_pointer;
typedef void const * krb5_const_pointer;

I'm thinking that instead something like:

typedef struct foo * krb5_pointer;
typedef struct foo const * krb5_const_pointer;

where struct foo is an incomplete struct type would be safer.  This
would allow the compiler to catch mismatches between the function
parameter and the given arg (realize that void * == void ** == void ***
and so on in C).  Note, I did this for some typedefs in our libgss and
we flushed out several bugs.  Just a thought.

Will Fiveash
Sun Microsystems Inc.
Austin, TX, USA (TZ=CST6CDT)
krbdev mailing list             [hidden email]