[330] in Kerberos_V5_Development

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

Mystifying problem with function prototypes....

daemon@ATHENA.MIT.EDU (Theodore Ts'o)
Tue Oct 16 14:40:52 1990

Date: Tue, 16 Oct 90 14:40:30 -0400
From: Theodore Ts'o <tytso@ATHENA.MIT.EDU>
To: krbdev@ATHENA.MIT.EDU
Reply-To: tytso@ATHENA.MIT.EDU

In kdb.h, I have the following lines (near the end)

/* XXX I give up.... the following int should be a krb5_boolean, but */
 /* it causes gcc to give up and die. */
krb5_boolean krb5_db_set_lockmode
	PROTOTYPE((int ));


The declaration, in kdb_dbm.c says:

krb5_boolean
krb5_dbm_db_set_lockmode(mode)
    krb5_boolean mode;

Yet if I change the function prototype in kdb.h so that
kdb5_db_set_lockmode takes a krb5_boolean instead of the int which is
show above, I get the wonderful error message:

kdb_dbm.c: In function krb5_db_set_lockmode:
kdb_dbm.c:976: argument `mode' doesn't match function prototype
kdb_dbm.c:976: a formal parameter type that promotes to `int'
kdb_dbm.c:976: can match only `int' in the prototype

Other prototypes in kdb.h reference krb5_boolean with out any problem at
all.  Can anyone figure it out?  Am I missing something really stupid?
I must be, since I've wasted far too much time trying to figure this
out..... 

						- Ted

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