From 5a9aa1607ff2bc94369c89f4c99725125b923977 Mon Sep 17 00:00:00 2001
From: Arjun <pkillarjun@protonmail.com>
Date: Thu, 9 May 2024 20:47:08 +0530
Subject: [PATCH 1/2] Fix more non-prototype functions

Add "void" designations to more function declarations and definitions
not changed by commits 3ae9244cd021a75eba909d872a92c25db490714d and
4b9d7f7c107f01a61600fddcd8cde3812d0366a2.

[ghudson@mit.edu: change additional functions; split into two commits;
rewrote commit message]

Upstream-Status: Backport [https://github.com/krb5/krb5/commit/623d649ba852839ba4822934bad9f97c184bf3ab]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 src/ccapi/common/win/OldCC/ccutils.c          |  2 +-
 src/ccapi/common/win/OldCC/ccutils.h          |  2 +-
 src/ccapi/common/win/OldCC/util.h             |  2 +-
 src/ccapi/common/win/win-utils.c              |  2 +-
 src/ccapi/common/win/win-utils.h              |  4 +-
 src/ccapi/lib/ccapi_context.h                 |  2 +-
 src/ccapi/lib/win/dllmain.h                   |  2 +-
 src/ccapi/server/ccs_server.c                 |  2 +-
 src/ccapi/server/ccs_server.h                 |  2 +-
 src/ccapi/server/win/WorkQueue.h              |  8 +--
 src/ccapi/test/pingtest.c                     |  2 +-
 src/include/gssrpc/netdb.h                    |  4 +-
 src/include/port-sockets.h                    |  2 +-
 src/kadmin/cli/getdate.y                      |  2 +-
 src/kadmin/dbutil/kdb5_util.c                 |  2 +-
 src/kprop/kprop.c                             |  2 +-
 src/lib/crypto/crypto_tests/t_pkcs5.c         |  4 +-
 src/lib/crypto/crypto_tests/vectors.c         | 10 ++--
 src/lib/gssapi/generic/maptest.c              |  2 +-
 src/lib/krb5/ccache/ccapi/stdcc.c             |  6 +-
 src/lib/krb5/ccache/ccapi/winccld.c           |  9 ++-
 src/lib/krb5/ccache/ccbase.c                  |  2 +-
 src/lib/krb5/krb/bld_princ.c                  |  4 +-
 src/lib/krb5/krb/conv_creds.c                 |  2 +-
 src/lib/krb5/krb/init_ctx.c                   |  2 +-
 src/lib/krb5/os/dnsglue.c                     |  4 +-
 src/lib/krb5/os/localaddr.c                   |  6 +-
 src/lib/rpc/getrpcent.c                       |  6 +-
 src/lib/win_glue.c                            |  8 +--
 src/plugins/kdb/db2/kdb_db2.c                 |  4 +-
 src/plugins/kdb/db2/libdb2/hash/dbm.c         |  2 +-
 .../kdb/ldap/libkdb_ldap/kdb_ldap_conn.c      |  4 +-
 src/tests/threads/gss-perf.c                  |  4 +-
 src/tests/threads/init_ctx.c                  |  2 +-
 src/tests/threads/profread.c                  |  2 +-
 src/tests/threads/t_rcache.c                  |  2 +-
 src/util/et/com_err.c                         |  4 +-
 src/util/et/error_message.c                   |  2 +-
 src/util/profile/prof_file.c                  |  4 +-
 src/util/support/secure_getenv.c              |  2 +-
 src/windows/include/leashwin.h                | 60 +++++++++----------
 41 files changed, 100 insertions(+), 99 deletions(-)

diff --git a/src/ccapi/common/win/OldCC/ccutils.c b/src/ccapi/common/win/OldCC/ccutils.c
index 403c67e..7abaefa 100644
--- a/src/ccapi/common/win/OldCC/ccutils.c
+++ b/src/ccapi/common/win/OldCC/ccutils.c
@@ -30,7 +30,7 @@
 #include "cci_debugging.h"
 #include "util.h"
 
-BOOL isNT() {
+BOOL isNT(void) {
     OSVERSIONINFO osvi;
     DWORD   status              = 0;
     BOOL    bSupportedVersion   = FALSE;
diff --git a/src/ccapi/common/win/OldCC/ccutils.h b/src/ccapi/common/win/OldCC/ccutils.h
index 9da3d87..0fb7e14 100644
--- a/src/ccapi/common/win/OldCC/ccutils.h
+++ b/src/ccapi/common/win/OldCC/ccutils.h
@@ -33,7 +33,7 @@ extern "C" {
 #define REPLY_SUFFIX    (char*)"reply"
 #define LISTEN_SUFFIX   (char*)"listen"
 
-BOOL    isNT();
+BOOL    isNT(void);
 char*   allocEventName   (char* uuid, char* suffix);
 HANDLE  createThreadEvent(char* uuid, char* suffix);
 HANDLE  openThreadEvent  (char* uuid, char* suffix);
diff --git a/src/ccapi/common/win/OldCC/util.h b/src/ccapi/common/win/OldCC/util.h
index 45e069a..7ee5319 100644
--- a/src/ccapi/common/win/OldCC/util.h
+++ b/src/ccapi/common/win/OldCC/util.h
@@ -30,7 +30,7 @@
 extern "C" {
 #endif
 
-BOOL isNT();
+BOOL isNT(void);
 
 void*
 user_allocate(
diff --git a/src/ccapi/common/win/win-utils.c b/src/ccapi/common/win/win-utils.c
index b49cca8..d9018a6 100644
--- a/src/ccapi/common/win/win-utils.c
+++ b/src/ccapi/common/win/win-utils.c
@@ -60,7 +60,7 @@ char* serverEndpoint(const char* user) {
     return _serverEndpoint;
     }
 
-char* timestamp() {
+char* timestamp(void) {
     SYSTEMTIME  _stime;
     GetSystemTime(&_stime);
     GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, &_stime, "HH:mm:ss", _ts, sizeof(_ts)-1);
diff --git a/src/ccapi/common/win/win-utils.h b/src/ccapi/common/win/win-utils.h
index 41cab24..94d0a9f 100644
--- a/src/ccapi/common/win/win-utils.h
+++ b/src/ccapi/common/win/win-utils.h
@@ -50,6 +50,6 @@ char*                   clientEndpoint(const char* UUID);
 char*                   serverEndpoint(const char* UUID);
 extern unsigned char*   pszProtocolSequence;
 
-char* timestamp();
+char* timestamp(void);
 
-#endif // _win_utils_h
\ No newline at end of file
+#endif // _win_utils_h
diff --git a/src/ccapi/lib/ccapi_context.h b/src/ccapi/lib/ccapi_context.h
index 51b8982..88f0ee8 100644
--- a/src/ccapi/lib/ccapi_context.h
+++ b/src/ccapi/lib/ccapi_context.h
@@ -79,7 +79,7 @@ cc_int32 ccapi_context_compare (cc_context_t  in_context,
                                 cc_uint32    *out_equal);
 
 #ifdef WIN32
-void cci_thread_init__auxinit();
+void cci_thread_init__auxinit(void);
 #endif
 
 
diff --git a/src/ccapi/lib/win/dllmain.h b/src/ccapi/lib/win/dllmain.h
index 8238566..28ca34e 100644
--- a/src/ccapi/lib/win/dllmain.h
+++ b/src/ccapi/lib/win/dllmain.h
@@ -32,7 +32,7 @@
 extern "C" {          // we need to export the C interface
 #endif
 
-DWORD GetTlsIndex();
+DWORD GetTlsIndex(void);
 
 #ifdef __cplusplus
 }
diff --git a/src/ccapi/server/ccs_server.c b/src/ccapi/server/ccs_server.c
index 1fc8d2c..de74b71 100644
--- a/src/ccapi/server/ccs_server.c
+++ b/src/ccapi/server/ccs_server.c
@@ -402,7 +402,7 @@ cc_int32 ccs_server_send_reply (ccs_pipe_t     in_reply_pipe,
 
 /* ------------------------------------------------------------------------ */
 
-cc_uint64 ccs_server_client_count ()
+cc_uint64 ccs_server_client_count (void)
 {
     return ccs_client_array_count (g_client_array);
 }
diff --git a/src/ccapi/server/ccs_server.h b/src/ccapi/server/ccs_server.h
index e920ad9..f71ab06 100644
--- a/src/ccapi/server/ccs_server.h
+++ b/src/ccapi/server/ccs_server.h
@@ -48,6 +48,6 @@ cc_int32 ccs_server_send_reply (ccs_pipe_t     in_reply_pipe,
                                 cc_int32       in_reply_err,
                                 k5_ipc_stream   in_reply_data);
 
-cc_uint64 ccs_server_client_count ();
+cc_uint64 ccs_server_client_count (void);
 
 #endif /* CCS_SERVER_H */
diff --git a/src/ccapi/server/win/WorkQueue.h b/src/ccapi/server/win/WorkQueue.h
index 68aa8b1..66a2960 100644
--- a/src/ccapi/server/win/WorkQueue.h
+++ b/src/ccapi/server/win/WorkQueue.h
@@ -29,14 +29,14 @@
 #include "windows.h"
 #include "ccs_pipe.h"
 
-EXTERN_C    int worklist_initialize();
+EXTERN_C    int worklist_initialize(void);
 
-EXTERN_C    int worklist_cleanup();
+EXTERN_C    int worklist_cleanup(void);
 
 /* Wait for work to be added to the list (via worklist_add) from another thread */
-EXTERN_C    void worklist_wait();
+EXTERN_C    void worklist_wait(void);
 
-EXTERN_C    BOOL worklist_isEmpty();
+EXTERN_C    BOOL worklist_isEmpty(void);
 
 EXTERN_C    int worklist_add(  const long          rpcmsg,
                                 const ccs_pipe_t    pipe,
diff --git a/src/ccapi/test/pingtest.c b/src/ccapi/test/pingtest.c
index 0ffc15e..24327c2 100644
--- a/src/ccapi/test/pingtest.c
+++ b/src/ccapi/test/pingtest.c
@@ -23,7 +23,7 @@ extern cc_int32 cci_os_ipc_msg( cc_int32        in_launch_server,
 
 static DWORD    dwTlsIndex;
 
-DWORD GetTlsIndex()    {return dwTlsIndex;}
+DWORD GetTlsIndex(void)    {return dwTlsIndex;}
 
 RPC_STATUS send_test(char* endpoint) {
     unsigned char*  pszNetworkAddress   = NULL;
diff --git a/src/include/gssrpc/netdb.h b/src/include/gssrpc/netdb.h
index f933fbb..2f62edf 100644
--- a/src/include/gssrpc/netdb.h
+++ b/src/include/gssrpc/netdb.h
@@ -53,6 +53,8 @@ struct rpcent {
 };
 #endif /*STRUCT_RPCENT_IN_RPC_NETDB_H*/
 
-struct rpcent *getrpcbyname(), *getrpcbynumber(), *getrpcent();
+struct rpcent *getrpcbyname(const char *name);
+struct rpcent *getrpcbynumber(int number);
+struct rpcent *getrpcent(void);
 
 #endif
diff --git a/src/include/port-sockets.h b/src/include/port-sockets.h
index 57e5d1d..228e4cf 100644
--- a/src/include/port-sockets.h
+++ b/src/include/port-sockets.h
@@ -111,7 +111,7 @@ static __inline void TranslatedWSASetLastError(int posix_error)
  * Translate Winsock errors to their POSIX counterparts.  This is necessary for
  * MSVC 2010+, where both Winsock and POSIX errors are defined.
  */
-static __inline int TranslatedWSAGetLastError()
+static __inline int TranslatedWSAGetLastError(void)
 {
     int err = WSAGetLastError();
     switch (err) {
diff --git a/src/kadmin/cli/getdate.y b/src/kadmin/cli/getdate.y
index 3d69f0b..b69e26e 100644
--- a/src/kadmin/cli/getdate.y
+++ b/src/kadmin/cli/getdate.y
@@ -775,7 +775,7 @@ LookupWord(char *buff)
 
 
 static int
-yylex()
+yylex(void)
 {
     char		c;
     char		*p;
diff --git a/src/kadmin/dbutil/kdb5_util.c b/src/kadmin/dbutil/kdb5_util.c
index 55d529f..3a07fd5 100644
--- a/src/kadmin/dbutil/kdb5_util.c
+++ b/src/kadmin/dbutil/kdb5_util.c
@@ -74,7 +74,7 @@ int exit_status = 0;
 krb5_context util_context;
 kadm5_config_params global_params;
 
-void usage()
+void usage(void)
 {
     fprintf(stderr,
             _("Usage: kdb5_util [-r realm] [-d dbname] "
diff --git a/src/kprop/kprop.c b/src/kprop/kprop.c
index 8f9fd69..e8f7feb 100644
--- a/src/kprop/kprop.c
+++ b/src/kprop/kprop.c
@@ -80,7 +80,7 @@ static void send_error(krb5_context context, krb5_creds *my_creds, int fd,
                        char *err_text, krb5_error_code err_code);
 static void update_last_prop_file(char *hostname, char *file_name);
 
-static void usage()
+static void usage(void)
 {
     fprintf(stderr, _("\nUsage: %s [-r realm] [-f file] [-d] [-P port] "
                       "[-s keytab] replica_host\n\n"), progname);
diff --git a/src/lib/crypto/crypto_tests/t_pkcs5.c b/src/lib/crypto/crypto_tests/t_pkcs5.c
index 8e87a80..f4bb33e 100644
--- a/src/lib/crypto/crypto_tests/t_pkcs5.c
+++ b/src/lib/crypto/crypto_tests/t_pkcs5.c
@@ -38,7 +38,7 @@ static void printdata (krb5_data *d) {
     printhex (d->length, d->data);
 }
 
-static void test_pbkdf2_rfc3211()
+static void test_pbkdf2_rfc3211(void)
 {
     char x[100];
     krb5_error_code err;
@@ -92,7 +92,7 @@ static void test_pbkdf2_rfc3211()
     }
 }
 
-int main ()
+int main(void)
 {
     test_pbkdf2_rfc3211();
     return 0;
diff --git a/src/lib/crypto/crypto_tests/vectors.c b/src/lib/crypto/crypto_tests/vectors.c
index bcf5c91..314d5c7 100644
--- a/src/lib/crypto/crypto_tests/vectors.c
+++ b/src/lib/crypto/crypto_tests/vectors.c
@@ -56,7 +56,7 @@ static void printdata (krb5_data *d) { printhex (d->length, d->data); }
 
 static void printkey (krb5_keyblock *k) { printhex (k->length, k->contents); }
 
-static void test_nfold ()
+static void test_nfold (void)
 {
     int i;
     static const struct {
@@ -96,7 +96,7 @@ static void test_nfold ()
    so try to generate them. */
 
 static void
-test_mit_des_s2k ()
+test_mit_des_s2k (void)
 {
     static const struct {
         const char *pass;
@@ -190,7 +190,7 @@ test_s2k (krb5_enctype enctype)
     }
 }
 
-static void test_des3_s2k () { test_s2k (ENCTYPE_DES3_CBC_SHA1); }
+static void test_des3_s2k (void) { test_s2k (ENCTYPE_DES3_CBC_SHA1); }
 
 static void
 keyToData (krb5_keyblock *k, krb5_data *d)
@@ -227,7 +227,7 @@ void DR (krb5_data *out, krb5_keyblock *in, const krb5_data *usage) {
 #define KEYBYTES  21
 #define KEYLENGTH 24
 
-void test_dr_dk ()
+void test_dr_dk (void)
 {
     static const struct {
         unsigned char keydata[KEYLENGTH];
@@ -371,7 +371,7 @@ static void printk(const char *descr, krb5_keyblock *k) {
 
 
 static void
-test_pbkdf2()
+test_pbkdf2(void)
 {
     static struct {
         int count;
diff --git a/src/lib/gssapi/generic/maptest.c b/src/lib/gssapi/generic/maptest.c
index 566d88c..ab3ed90 100644
--- a/src/lib/gssapi/generic/maptest.c
+++ b/src/lib/gssapi/generic/maptest.c
@@ -42,7 +42,7 @@ static void intprt(int v, FILE *f)
 
 foo foo1;
 
-int main ()
+int main (void)
 {
     elt v1 = { 1, 2 }, v2 = { 3, 4 };
     const elt *vp;
diff --git a/src/lib/krb5/ccache/ccapi/stdcc.c b/src/lib/krb5/ccache/ccapi/stdcc.c
index 427b329..9cd2ad3 100644
--- a/src/lib/krb5/ccache/ccapi/stdcc.c
+++ b/src/lib/krb5/ccache/ccapi/stdcc.c
@@ -101,7 +101,7 @@ krb5_cc_ops krb5_cc_stdcc_ops = {
  * changes made.  We register a unique message type with which
  * we'll communicate to all other processes.
  */
-static void cache_changed()
+static void cache_changed(void)
 {
     static unsigned int message = 0;
 
@@ -112,7 +112,7 @@ static void cache_changed()
 }
 #else /* _WIN32 */
 
-static void cache_changed()
+static void cache_changed(void)
 {
     return;
 }
@@ -242,7 +242,7 @@ static krb5_error_code stdccv3_setup (krb5_context context,
 }
 
 /* krb5_stdcc_shutdown is exported; use the old name */
-void krb5_stdcc_shutdown()
+void krb5_stdcc_shutdown(void)
 {
     if (gCntrlBlock) { cc_context_release(gCntrlBlock); }
     gCntrlBlock = NULL;
diff --git a/src/lib/krb5/ccache/ccapi/winccld.c b/src/lib/krb5/ccache/ccapi/winccld.c
index 8b2e90c..62b1bd7 100644
--- a/src/lib/krb5/ccache/ccapi/winccld.c
+++ b/src/lib/krb5/ccache/ccapi/winccld.c
@@ -18,8 +18,8 @@ extern const krb5_cc_ops krb5_fcc_ops;
 
 static int krb5_win_ccdll_loaded = 0;
 
-extern void krb5_win_ccdll_load();
-extern int krb5_is_ccdll_loaded();
+extern void krb5_win_ccdll_load(krb5_context context);
+extern int krb5_is_ccdll_loaded(void);
 
 /*
  * return codes
@@ -81,8 +81,7 @@ static int LoadFuncs(const char* dll_name, FUNC_INFO fi[],
     return LF_OK;
 }
 
-void krb5_win_ccdll_load(context)
-    krb5_context    context;
+void krb5_win_ccdll_load(krb5_context context)
 {
     krb5_cc_register(context, &krb5_fcc_ops, 0);
     if (krb5_win_ccdll_loaded)
@@ -93,7 +92,7 @@ void krb5_win_ccdll_load(context)
     krb5_cc_dfl_ops = &krb5_cc_stdcc_ops; /* Use stdcc! */
 }
 
-int krb5_is_ccdll_loaded()
+int krb5_is_ccdll_loaded(void)
 {
     return krb5_win_ccdll_loaded;
 }
diff --git a/src/lib/krb5/ccache/ccbase.c b/src/lib/krb5/ccache/ccbase.c
index 5a01320..696b681 100644
--- a/src/lib/krb5/ccache/ccbase.c
+++ b/src/lib/krb5/ccache/ccbase.c
@@ -614,7 +614,7 @@ k5_cccol_unlock(krb5_context context)
 
 /* necessary to make reentrant locks play nice with krb5int_cc_finalize */
 void
-k5_cccol_force_unlock()
+k5_cccol_force_unlock(void)
 {
     /* sanity check */
     if ((&cccol_lock)->refcount == 0) {
diff --git a/src/lib/krb5/krb/bld_princ.c b/src/lib/krb5/krb/bld_princ.c
index ff8265a..701454f 100644
--- a/src/lib/krb5/krb/bld_princ.c
+++ b/src/lib/krb5/krb/bld_princ.c
@@ -170,13 +170,13 @@ const krb5_principal_data anon_princ = {
 };
 
 const krb5_data * KRB5_CALLCONV
-krb5_anonymous_realm()
+krb5_anonymous_realm(void)
 {
     return &anon_realm_data;
 }
 
 krb5_const_principal KRB5_CALLCONV
-krb5_anonymous_principal()
+krb5_anonymous_principal(void)
 {
     return &anon_princ;
 }
diff --git a/src/lib/krb5/krb/conv_creds.c b/src/lib/krb5/krb/conv_creds.c
index 6f46088..8d0a317 100644
--- a/src/lib/krb5/krb/conv_creds.c
+++ b/src/lib/krb5/krb/conv_creds.c
@@ -55,7 +55,7 @@ krb524_convert_creds_kdc(krb5_context context, krb5_creds *v5creds,
     return KRB524_KRB4_DISABLED;
 }
 
-void KRB5_CALLCONV krb524_init_ets ()
+void KRB5_CALLCONV krb524_init_ets (void)
 {
 }
 #endif
diff --git a/src/lib/krb5/krb/init_ctx.c b/src/lib/krb5/krb/init_ctx.c
index a6c2bbe..8fd9403 100644
--- a/src/lib/krb5/krb/init_ctx.c
+++ b/src/lib/krb5/krb/init_ctx.c
@@ -66,7 +66,7 @@ static krb5_enctype default_enctype_list[] = {
 };
 
 #if (defined(_WIN32))
-extern krb5_error_code krb5_vercheck();
+extern krb5_error_code krb5_vercheck(void);
 extern void krb5_win_ccdll_load(krb5_context context);
 #endif
 
diff --git a/src/lib/krb5/os/dnsglue.c b/src/lib/krb5/os/dnsglue.c
index 668a7a6..5da550c 100644
--- a/src/lib/krb5/os/dnsglue.c
+++ b/src/lib/krb5/os/dnsglue.c
@@ -439,7 +439,7 @@ cleanup:
 }
 
 char *
-k5_primary_domain()
+k5_primary_domain(void)
 {
     return NULL;
 }
@@ -497,7 +497,7 @@ errout:
 }
 
 char *
-k5_primary_domain()
+k5_primary_domain(void)
 {
     char *domain;
     DECLARE_HANDLE(h);
diff --git a/src/lib/krb5/os/localaddr.c b/src/lib/krb5/os/localaddr.c
index 92d765f..4e9d07f 100644
--- a/src/lib/krb5/os/localaddr.c
+++ b/src/lib/krb5/os/localaddr.c
@@ -363,7 +363,7 @@ struct linux_ipv6_addr_list {
     struct linux_ipv6_addr_list *next;
 };
 static struct linux_ipv6_addr_list *
-get_linux_ipv6_addrs ()
+get_linux_ipv6_addrs (void)
 {
     struct linux_ipv6_addr_list *lst = 0;
     FILE *f;
@@ -1082,7 +1082,7 @@ static int print_addr (/*@unused@*/ void *dataptr, struct sockaddr *sa)
     return 0;
 }
 
-int main ()
+int main (void)
 {
     int r;
 
@@ -1417,7 +1417,7 @@ get_localaddrs (krb5_context context, krb5_address ***addr, int use_profile)
  * by Robert Quinn
  */
 #if defined(_WIN32)
-static struct hostent *local_addr_fallback_kludge()
+static struct hostent *local_addr_fallback_kludge(void)
 {
     static struct hostent   host;
     static SOCKADDR_IN      addr;
diff --git a/src/lib/rpc/getrpcent.c b/src/lib/rpc/getrpcent.c
index ad6793f..b3d94bc 100644
--- a/src/lib/rpc/getrpcent.c
+++ b/src/lib/rpc/getrpcent.c
@@ -56,10 +56,10 @@ struct rpcdata {
 	char	line[BUFSIZ+1];
 	char	*domain;
 } *rpcdata;
-static struct rpcdata *get_rpcdata();
+static struct rpcdata *get_rpcdata(void);
 
-static	struct rpcent *interpret();
-struct	hostent *gethostent();
+static	struct rpcent *interpret(void);
+struct	hostent *gethostent(void);
 
 static char RPCDB[] = "/etc/rpc";
 
diff --git a/src/lib/win_glue.c b/src/lib/win_glue.c
index d650cc3..011acda 100644
--- a/src/lib/win_glue.c
+++ b/src/lib/win_glue.c
@@ -6,7 +6,7 @@
 #include "asn1_err.h"
 #include "kdb5_err.h"
 #include "profile.h"
-extern void krb5_stdcc_shutdown();
+extern void krb5_stdcc_shutdown(void);
 #endif
 #ifdef GSSAPI
 #include "gssapi/generic/gssapi_err_generic.h"
@@ -233,7 +233,7 @@ static int CallVersionServer(app_title, app_version, app_ini, code_cover)
 #endif
 
 #ifdef TIMEBOMB
-static krb5_error_code do_timebomb()
+static krb5_error_code do_timebomb(void)
 {
 	char buf[1024];
 	long timeleft;
@@ -276,7 +276,7 @@ static krb5_error_code do_timebomb()
  * doesn't allow you to make messaging calls from LibMain.  So, we now
  * do the timebomb/version server stuff from krb5_init_context().
  */
-krb5_error_code krb5_vercheck()
+krb5_error_code krb5_vercheck(void)
 {
 	static int verchecked = 0;
 	if (verchecked)
@@ -314,7 +314,7 @@ krb5_error_code krb5_vercheck()
 
 static HINSTANCE hlibinstance;
 
-HINSTANCE get_lib_instance()
+HINSTANCE get_lib_instance(void)
 {
     return hlibinstance;
 }
diff --git a/src/plugins/kdb/db2/kdb_db2.c b/src/plugins/kdb/db2/kdb_db2.c
index 2c163d9..381228e 100644
--- a/src/plugins/kdb/db2/kdb_db2.c
+++ b/src/plugins/kdb/db2/kdb_db2.c
@@ -1165,13 +1165,13 @@ krb5_db2_set_lockmode(krb5_context context, krb5_boolean mode)
  *     DAL API functions
  */
 krb5_error_code
-krb5_db2_lib_init()
+krb5_db2_lib_init(void)
 {
     return 0;
 }
 
 krb5_error_code
-krb5_db2_lib_cleanup()
+krb5_db2_lib_cleanup(void)
 {
     /* right now, no cleanup required */
     return 0;
diff --git a/src/plugins/kdb/db2/libdb2/hash/dbm.c b/src/plugins/kdb/db2/libdb2/hash/dbm.c
index 2dca256..8e23d4c 100644
--- a/src/plugins/kdb/db2/libdb2/hash/dbm.c
+++ b/src/plugins/kdb/db2/libdb2/hash/dbm.c
@@ -95,7 +95,7 @@ kdb2_fetch(datum key)
 }
 
 datum
-kdb2_firstkey()
+kdb2_firstkey(void)
 {
 	datum item;
 
diff --git a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c
index cee4b7b..5e77d5e 100644
--- a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c
+++ b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c
@@ -314,13 +314,13 @@ krb5_ldap_rebind(krb5_ldap_context *ldap_context,
  *     DAL API functions
  */
 krb5_error_code
-krb5_ldap_lib_init()
+krb5_ldap_lib_init(void)
 {
     return 0;
 }
 
 krb5_error_code
-krb5_ldap_lib_cleanup()
+krb5_ldap_lib_cleanup(void)
 {
     /* right now, no cleanup required */
     return 0;
diff --git a/src/tests/threads/gss-perf.c b/src/tests/threads/gss-perf.c
index f3630c2..0ca6d84 100644
--- a/src/tests/threads/gss-perf.c
+++ b/src/tests/threads/gss-perf.c
@@ -78,7 +78,7 @@ static void usage (void) __attribute__((noreturn));
 static void set_target (char *);
 
 static void
-usage ()
+usage (void)
 {
     fprintf (stderr, "usage: %s [ options ] service-name\n", prog);
     fprintf (stderr, "  service-name\tGSSAPI host-based service name (e.g., 'host@FQDN')\n");
@@ -249,7 +249,7 @@ do_accept (gss_buffer_desc *msg, int iter)
 }
 
 static gss_buffer_desc
-do_init ()
+do_init (void)
 {
     OM_uint32 maj_stat, min_stat;
     gss_ctx_id_t ctx = GSS_C_NO_CONTEXT;
diff --git a/src/tests/threads/init_ctx.c b/src/tests/threads/init_ctx.c
index 42619a9..dc3d417 100644
--- a/src/tests/threads/init_ctx.c
+++ b/src/tests/threads/init_ctx.c
@@ -57,7 +57,7 @@ static int do_pause;
 static void usage (void) __attribute__((noreturn));
 
 static void
-usage ()
+usage (void)
 {
     fprintf (stderr, "usage: %s [ options ]\n", prog);
     fprintf (stderr, "options:\n");
diff --git a/src/tests/threads/profread.c b/src/tests/threads/profread.c
index be28ba4..69bdb05 100644
--- a/src/tests/threads/profread.c
+++ b/src/tests/threads/profread.c
@@ -59,7 +59,7 @@ static int do_pause;
 static void usage (void) __attribute__((noreturn));
 
 static void
-usage ()
+usage (void)
 {
     fprintf (stderr, "usage: %s [ options ]\n", prog);
     fprintf (stderr, "options:\n");
diff --git a/src/tests/threads/t_rcache.c b/src/tests/threads/t_rcache.c
index 07c45cc..8121429 100644
--- a/src/tests/threads/t_rcache.c
+++ b/src/tests/threads/t_rcache.c
@@ -51,7 +51,7 @@ int n_threads = DEFAULT_N_THREADS;
 int interval = DEFAULT_INTERVAL;
 int *ip;
 
-static void wait_for_tick ()
+static void wait_for_tick (void)
 {
     time_t now, next;
     now = time(0);
diff --git a/src/util/et/com_err.c b/src/util/et/com_err.c
index c1e3be7..2e74a4f 100644
--- a/src/util/et/com_err.c
+++ b/src/util/et/com_err.c
@@ -35,7 +35,7 @@ static /*@null@*/ et_old_error_hook_func com_err_hook = 0;
 k5_mutex_t com_err_hook_lock = K5_MUTEX_PARTIAL_INITIALIZER;
 
 #if defined(_WIN32)
-BOOL  isGuiApp() {
+BOOL  isGuiApp(void) {
     DWORD mypid;
     HANDLE myprocess;
     mypid = GetCurrentProcessId();
@@ -161,7 +161,7 @@ et_old_error_hook_func set_com_err_hook (et_old_error_hook_func new_proc)
     return x;
 }
 
-et_old_error_hook_func reset_com_err_hook ()
+et_old_error_hook_func reset_com_err_hook (void)
 {
     et_old_error_hook_func x;
 
diff --git a/src/util/et/error_message.c b/src/util/et/error_message.c
index 13ad3af..94445a9 100644
--- a/src/util/et/error_message.c
+++ b/src/util/et/error_message.c
@@ -303,7 +303,7 @@ remove_error_table(const struct error_table *et)
     return ENOENT;
 }
 
-int com_err_finish_init()
+int com_err_finish_init(void)
 {
     return CALL_INIT_FUNCTION(com_err_initialize);
 }
diff --git a/src/util/profile/prof_file.c b/src/util/profile/prof_file.c
index aa951df..c10a368 100644
--- a/src/util/profile/prof_file.c
+++ b/src/util/profile/prof_file.c
@@ -509,11 +509,11 @@ void profile_dereference_data_locked(prf_data_t data)
         profile_free_file_data(data);
 }
 
-void profile_lock_global()
+void profile_lock_global(void)
 {
     k5_mutex_lock(&g_shared_trees_mutex);
 }
-void profile_unlock_global()
+void profile_unlock_global(void)
 {
     k5_mutex_unlock(&g_shared_trees_mutex);
 }
diff --git a/src/util/support/secure_getenv.c b/src/util/support/secure_getenv.c
index 6df0591..c9b34b6 100644
--- a/src/util/support/secure_getenv.c
+++ b/src/util/support/secure_getenv.c
@@ -68,7 +68,7 @@ static int elevated_privilege = 0;
 MAKE_INIT_FUNCTION(k5_secure_getenv_init);
 
 int
-k5_secure_getenv_init()
+k5_secure_getenv_init(void)
 {
     int saved_errno = errno;
 
diff --git a/src/windows/include/leashwin.h b/src/windows/include/leashwin.h
index 08b9c7d..c85e6df 100644
--- a/src/windows/include/leashwin.h
+++ b/src/windows/include/leashwin.h
@@ -160,51 +160,51 @@ void Leash_reset_defaults(void);
 #define GOOD_TICKETS 1
 
 /* Leash Configuration functions - alters Current User Registry */
-DWORD Leash_get_default_lifetime();
+DWORD Leash_get_default_lifetime(void);
 DWORD Leash_set_default_lifetime(DWORD minutes);
-DWORD Leash_reset_default_lifetime();
-DWORD Leash_get_default_renew_till();
+DWORD Leash_reset_default_lifetime(void);
+DWORD Leash_get_default_renew_till(void);
 DWORD Leash_set_default_renew_till(DWORD minutes);
-DWORD Leash_reset_default_renew_till();
-DWORD Leash_get_default_renewable();
+DWORD Leash_reset_default_renew_till(void);
+DWORD Leash_get_default_renewable(void);
 DWORD Leash_set_default_renewable(DWORD onoff);
-DWORD Leash_reset_default_renewable();
-DWORD Leash_get_default_forwardable();
+DWORD Leash_reset_default_renewable(void);
+DWORD Leash_get_default_forwardable(void);
 DWORD Leash_set_default_forwardable(DWORD onoff);
-DWORD Leash_reset_default_forwardable();
-DWORD Leash_get_default_noaddresses();
+DWORD Leash_reset_default_forwardable(void);
+DWORD Leash_get_default_noaddresses(void);
 DWORD Leash_set_default_noaddresses(DWORD onoff);
-DWORD Leash_reset_default_noaddresses();
-DWORD Leash_get_default_proxiable();
+DWORD Leash_reset_default_noaddresses(void);
+DWORD Leash_get_default_proxiable(void);
 DWORD Leash_set_default_proxiable(DWORD onoff);
-DWORD Leash_reset_default_proxiable();
-DWORD Leash_get_default_publicip();
+DWORD Leash_reset_default_proxiable(void);
+DWORD Leash_get_default_publicip(void);
 DWORD Leash_set_default_publicip(DWORD ipv4addr);
-DWORD Leash_reset_default_publicip();
-DWORD Leash_get_hide_kinit_options();
+DWORD Leash_reset_default_publicip(void);
+DWORD Leash_get_hide_kinit_options(void);
 DWORD Leash_set_hide_kinit_options(DWORD onoff);
-DWORD Leash_reset_hide_kinit_options();
-DWORD Leash_get_default_life_min();
+DWORD Leash_reset_hide_kinit_options(void);
+DWORD Leash_get_default_life_min(void);
 DWORD Leash_set_default_life_min(DWORD minutes);
-DWORD Leash_reset_default_life_min();
-DWORD Leash_get_default_life_max();
+DWORD Leash_reset_default_life_min(void);
+DWORD Leash_get_default_life_max(void);
 DWORD Leash_set_default_life_max(DWORD minutes);
-DWORD Leash_reset_default_life_max();
-DWORD Leash_get_default_renew_min();
+DWORD Leash_reset_default_life_max(void);
+DWORD Leash_get_default_renew_min(void);
 DWORD Leash_set_default_renew_min(DWORD minutes);
-DWORD Leash_reset_default_renew_min();
-DWORD Leash_get_default_renew_max();
+DWORD Leash_reset_default_renew_min(void);
+DWORD Leash_get_default_renew_max(void);
 DWORD Leash_set_default_renew_max(DWORD minutes);
-DWORD Leash_reset_default_renew_max();
-DWORD Leash_get_default_uppercaserealm();
+DWORD Leash_reset_default_renew_max(void);
+DWORD Leash_get_default_uppercaserealm(void);
 DWORD Leash_set_default_uppercaserealm(DWORD onoff);
-DWORD Leash_reset_default_uppercaserealm();
-DWORD Leash_get_default_mslsa_import();
+DWORD Leash_reset_default_uppercaserealm(void);
+DWORD Leash_get_default_mslsa_import(void);
 DWORD Leash_set_default_mslsa_import(DWORD onoffmatch);
-DWORD Leash_reset_default_mslsa_import();
-DWORD Leash_get_default_preserve_kinit_settings();
+DWORD Leash_reset_default_mslsa_import(void);
+DWORD Leash_get_default_preserve_kinit_settings(void);
 DWORD Leash_set_default_preserve_kinit_settings(DWORD onoff);
-DWORD Leash_reset_default_preserve_kinit_settings();
+DWORD Leash_reset_default_preserve_kinit_settings(void);
 #ifdef __cplusplus
 }
 #endif
