kauth: Resolve date signedness warning in SetFields
authorAnders Kaseorg <andersk@mit.edu>
Fri, 31 Jul 2015 05:49:03 +0000 (01:49 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Thu, 27 Aug 2015 01:36:36 +0000 (21:36 -0400)
Resolves this warning:

admin_tools.c: In function ‘SetFields’:
admin_tools.c:611:30: warning: pointer targets in passing argument 2 of ‘ktime_DateToInt32’ differ in signedness [-Wpointer-sign]
  code = ktime_DateToInt32(s, &expiration);
                              ^
In file included from /home/anders/wd/openafs/include/afs/afsutil.h:84:0,
                 from admin_tools.c:39:
/home/anders/wd/openafs/include/afs/afsutil_prototypes.h:101:18: note: expected ‘afs_int32 *’ but argument is of type ‘afs_uint32 *’
 extern afs_int32 ktime_DateToInt32(char *adate, afs_int32 * aint32);
                  ^

Change-Id: Id24e7a6cd1ab2291c0c05d3835f4ad7fddfec8d7
Reviewed-on: http://gerrit.openafs.org/11956
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

CODING
src/kauth/Makefile.in
src/kauth/admin_tools.c

diff --git a/CODING b/CODING
index 1780b0c..8e1891d 100644 (file)
--- a/CODING
+++ b/CODING
@@ -255,7 +255,7 @@ bucoord/commands.c   : all       : Ubik_Call
                                     : signed vs unsigned for dates
 butc/tcudbprocs.c    : all          : ubik_Call
 external/heimdal/hcrypto/validate.c: all: statement with empty body
-kauth/admin_tools.c  : all           : signed vs unsigned for dates
+kauth/admin_tools.c  : strict-proto  : ubik_Call
 kauth/authclient.c   : strict-proto  : ubik_Call nonsense
 libadmin/kas/afs_kasAdmin.c: strict-proto : ubik_Call nonsense
 libadmin/samples/rxstat_query_peer.c : all : util_RPCStatsStateGet types
index e0efbf6..cffe8ea 100644 (file)
@@ -185,7 +185,6 @@ libkauth.krb.a: $(KRB_objs)
 
 kas.o: kas.c ${INCLS} AFS_component_version_number.o
 
-CFLAGS_admin_tools.o= @CFLAGS_NOERROR@
 admin_tools.o: admin_tools.c ${INCLS} kaport.h
 
 kkids.o: kkids.c ${INCLS}
index 14706e9..9ec5706 100644 (file)
 #include <afs/param.h>
 #include <afs/stds.h>
 
+#ifdef IGNORE_SOME_GCC_WARNINGS
+# pragma GCC diagnostic warning "-Wstrict-prototypes"
+#endif
+
 #include <roken.h>
 #include <afs/opr.h>
 #include <afs/opr_assert.h>
@@ -581,7 +585,7 @@ SetFields(struct cmd_syndesc *as, void *arock)
     char instance[MAXKTCNAMELEN];
     char *end;
     afs_int32 flags = 0;
-    Date expiration = 0;
+    afs_int32 expiration = 0;
     afs_int32 lifetime = 0;
     afs_int32 maxAssociates = -1;
     afs_int32 pwexpiry = 0;