From 36be36e034141ded8fff5ff2edab3223b23c9fcf Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 7 Oct 2009 17:48:52 -0500 Subject: [PATCH] Fix warnings in kauth/authclient.c -- In ka_Authenticate, explicitly cast 'start' and 'end' to void*, since kawrap_ubik_Call takes all arguments as void*s -- Fix kawrap_ubik_Call to not be an old-style declaration -- Only ignore strict prototypes and implicit function declaration warnings Reviewed-on: http://gerrit.openafs.org/597 Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear --- README.WARNINGS | 3 ++- src/kauth/Makefile.in | 2 +- src/kauth/authclient.c | 14 ++++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/README.WARNINGS b/README.WARNINGS index 6dd52eda8..106c10120 100644 --- a/README.WARNINGS +++ b/README.WARNINGS @@ -68,7 +68,8 @@ kauth/kaprocs.c : all : XXX kauth/kaserver.c : all : ExtendedCellInfo kauth/krb_udp.c : all : XXX kauth/admin_tools.c : all : ubik_Call nonsense -kauth/authclient.c : all : ubik_Call nonsense +kauth/authclient.c : strict-proto : ubik_Call nonsense + : implicit-func : ubik_Call nonsense kauth/kas.c : all : XXX kauth/klog.c : all : XXX kauth/ka-forwarder.c : all : XXX diff --git a/src/kauth/Makefile.in b/src/kauth/Makefile.in index 7b81fba9c..fa104808d 100644 --- a/src/kauth/Makefile.in +++ b/src/kauth/Makefile.in @@ -101,7 +101,7 @@ kaprocs.o: kaprocs.c ${INCLS} kaport.h ${CC} ${CFLAGS} @CFLAGS_NOERROR@ -c $< authclient.o: authclient.c ${INCLS} - $(CC) $(CFLAGS) @CFLAGS_NOERROR@ -c $< + $(CC) $(CFLAGS) -c $< kaauxdb.o: kaauxdb.c $(CC) $(CFLAGS) @CFLAGS_NOERROR@ -c $< diff --git a/src/kauth/authclient.c b/src/kauth/authclient.c index 4feba287b..560f4ce89 100644 --- a/src/kauth/authclient.c +++ b/src/kauth/authclient.c @@ -16,6 +16,10 @@ #include #endif +#ifdef IGNORE_SOME_GCC_WARNINGS +# pragma GCC diagnostic warning "-Wstrict-prototypes" +# pragma GCC diagnostic warning "-Wimplicit-function-declaration" +#endif #define UBIK_LEGACY_CALLITER 1 @@ -456,11 +460,9 @@ CheckTicketAnswer(ka_BBS * oanswer, afs_int32 challenge, * this doesn't handle UNOTSYNC very well, should use ubik_Call if you care */ static afs_int32 -kawrap_ubik_Call(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8) - struct ubik_client *aclient; - int (*aproc) (); - afs_int32 aflags; - void *p1, *p2, *p3, *p4, *p5, *p6, *p7, *p8; +kawrap_ubik_Call(int (*aproc) (), struct ubik_client *aclient, + afs_int32 aflags, void *p1, void *p2, void *p3, void *p4, + void *p5, void *p6, void *p7, void *p8) { afs_int32 code, lcode; int count; @@ -562,7 +564,7 @@ ka_Authenticate(char *name, char *instance, char *cell, struct ubik_client * con version = 2; code = kawrap_ubik_Call(KAA_AuthenticateV2, conn, 0, name, instance, - start, end, &arequest, &oanswer, 0, 0); + (void*)start, (void*)end, &arequest, &oanswer, 0, 0); if (code == RXGEN_OPCODE) { oanswer.MaxSeqLen = sizeof(answer); oanswer.SeqBody = (char *)&answer; -- 2.39.5