[429] in Kerberos_V5_Development
Narrow vs. Wide function prototypes
jtkohl@ATHENA.MIT.EDU (jtkohl@ATHENA.MIT.EDU)
Thu Nov 15 09:43:01 1990
I'm trying to figure out a non-dirty way (I don't think there is a clean way)
to allow function prototypes to work in the following ways:
1) Full ANSI environment, with narrow prototypes and narrow arguments in
functions (easy, does it now)
2) half-ANSI environment, with wide arguments in prototypes (hard part)
(e.g. compile with ANSI compiler, allow linking with non-ANSI compiled
code)
3) non-ANSI environment, no prototypes (easy, does it now)
#2 provides some thorny issues, because you want to preserve things like
short *, but promote shorts.
Some possibilities, after speaking with Ralph and thinking a bit:
a) essentially duplicate the X11 stuff, which reserves a portion of the
prototype declaration file to have the promoted types #defined to
the promoted type. This is mostly OK, but requires special hackery for
functions which take both pointers to and instances of types which get
promoted.
b) providing a whole extra set of types specifically for use in function
prototypes, e.g. krb5_widened_enctype, etc. However, this then makes
the function declaration not look the same as the declared function
signature.
Any other ideas/suggestions?