]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Avoid strict-prototype compiler errors 1327/head
authorSteffen Kieß <steffen.kiess@cis.iti.uni-stuttgart.de>
Tue, 13 Feb 2024 17:39:27 +0000 (18:39 +0100)
committerGreg Hudson <ghudson@mit.edu>
Tue, 13 Feb 2024 22:12:32 +0000 (17:12 -0500)
Commit 4b9d7f7c107f01a61600fddcd8cde3812d0366a2 added the
-Werror=strict-prototypes parameter to the build process, but left
behind 28 function definitions using "()" instead of "(void)".  Most
of these definitions could not cause compiler errors for various
reasons (such as an accompanying prototype), but a few could cause
errors in gcc depending on the build configuration.

For consistency and safety, add "(void)" to all 28 definitions.

[ghudson@mit.edu: rewrote commit message]

21 files changed:
src/clients/kcpytkt/kcpytkt.c
src/clients/kdeltkt/kdeltkt.c
src/clients/kinit/kinit.c
src/clients/kinit/kinit_kdb.c
src/clients/klist/klist.c
src/kadmin/cli/kadmin.c
src/kadmin/dbutil/kdb5_util.c
src/kdc/main.c
src/kprop/kpropd.c
src/lib/crypto/builtin/enc_provider/aes.c
src/lib/crypto/openssl/hmac.c
src/lib/krb5/ccache/t_memory.c
src/lib/krb5/ccache/t_stdio.c
src/plugins/kdb/db2/libdb2/btree/bt_debug.c
src/plugins/kdb/db2/libdb2/btree/bt_open.c
src/plugins/kdb/db2/libdb2/hash/dbm.c
src/plugins/kdb/db2/libdb2/test/btree.tests/main.c
src/plugins/kdb/db2/libdb2/test/dbtest.c
src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
src/plugins/tls/k5tls/openssl.c
src/tests/asn.1/make-vectors.c

index 0b8802261e9e8f30f61df3bf806c482c56a97606..f1d50e5de0052fa6e4065a2731b3576770cc76be 100644 (file)
@@ -10,7 +10,7 @@ static char *prog;
 static int quiet = 0;
 
 static void
-xusage()
+xusage(void)
 {
     fprintf(stderr, "xusage: %s [-c from_ccache] [-e etype] [-f flags] "
             "dest_ccache service1 service2 ...\n", prog);
index cd0bf637db69a5dcbbb50079a14acdf1789a0c67..66a32a8bd3bd71ec271c7242fed5f036fd78aec4 100644 (file)
@@ -10,7 +10,7 @@ static char *prog;
 static int quiet = 0;
 
 static void
-xusage()
+xusage(void)
 {
     fprintf(stderr, "xusage: %s [-c ccache] [-e etype] [-f flags] service1 "
             "service2 ...\n", prog);
index 7a33ffae59618579005be727dfa667456ecceba2..b27b723f2dcc33d1b267612d0f8ef12fc72fe6f4 100644 (file)
@@ -55,7 +55,7 @@ get_name_from_os(void)
 #else /* HAVE_PWD_H */
 #ifdef _WIN32
 static char *
-get_name_from_os()
+get_name_from_os(void)
 {
     static char name[1024];
     DWORD name_size = sizeof(name);
@@ -69,7 +69,7 @@ get_name_from_os()
 }
 #else /* _WIN32 */
 static char *
-get_name_from_os()
+get_name_from_os(void)
 {
     return NULL;
 }
index fbd174bf0c4512c298c692ebdf30904d5b09b1d1..4e7cd501693fa1197c22b55389efb7ff8fae473c 100644 (file)
@@ -69,7 +69,7 @@ kinit_kdb_init(krb5_context *pcontext, char *realm)
 }
 
 void
-kinit_kdb_fini()
+kinit_kdb_fini(void)
 {
     kadm5_destroy(server_handle);
 }
index b5808e5c934efd88d2fc1080b8a43a04416bcc33..cfa1d2e77ec885023302b8be1d1d5a5be9896b9a 100644 (file)
@@ -358,7 +358,7 @@ do_keytab(const char *name)
 }
 
 static void
-list_all_ccaches()
+list_all_ccaches(void)
 {
     krb5_error_code ret;
     krb5_ccache cache;
@@ -450,7 +450,7 @@ show_all_ccaches(void)
 }
 
 static void
-do_ccache()
+do_ccache(void)
 {
     krb5_error_code ret;
     krb5_ccache cache;
index 23b64b0f58a6fe18c027d9f4b3ffa549b80bae18..c1256f77086bb2650ec5f168b3ef6cb32ec7b233 100644 (file)
@@ -607,7 +607,7 @@ kadmin_startup(int argc, char *argv[], char **request_out, char ***args_out)
 }
 
 int
-quit()
+quit(void)
 {
     kadm5_ret_t retval;
 
index 55d529fa4ced56f68bcd527ff0331cec95657c46..b9b61e3f91b95d1c9165b4cf80d2ccdfc081bd8d 100644 (file)
@@ -367,7 +367,7 @@ main(int argc, char *argv[])
  * program is run).
  */
 static int
-open_db_and_mkey()
+open_db_and_mkey(void)
 {
     krb5_error_code retval;
     krb5_data scratch, pwd, seed;
@@ -489,7 +489,7 @@ open_db_and_mkey()
 #endif
 
 int
-quit()
+quit(void)
 {
     krb5_error_code retval;
     static krb5_boolean finished = 0;
index bfdfef5c48936fa698a6d69fcc202066e37f46af..ad1d1bfd9cc40f479bfa804cf25692e049664eaf 100644 (file)
@@ -854,7 +854,7 @@ write_pid_file(const char *path)
 }
 
 static void
-finish_realms()
+finish_realms(void)
 {
     int i;
 
index 8da9c0ff78f27fedf371c78de71f8a73122ad009..e7ce31f83ce588c4287628713d33d5b67fa2f0b5 100644 (file)
@@ -376,7 +376,7 @@ get_wildcard_addr(struct addrinfo **res)
 }
 
 static void
-do_standalone()
+do_standalone(void)
 {
     struct sockaddr_in frominet;
     struct addrinfo *res;
@@ -630,7 +630,7 @@ full_resync(CLIENT *clnt)
  * Returns non-zero on failure due to errors.
  */
 krb5_error_code
-do_iprop()
+do_iprop(void)
 {
     kadm5_ret_t retval;
     krb5_principal iprop_svc_principal = NULL;
index 7fa9449797e76553df19e71528e1a747f0be96bb..39e2a840059c15fd5eb5fa5a81e64a9410b2e3f7 100644 (file)
@@ -69,7 +69,7 @@ void k5_iEnc256_CBC(struct aes_data *data);
 void k5_iDec256_CBC(struct aes_data *data);
 
 static krb5_boolean
-aesni_supported_by_cpu()
+aesni_supported_by_cpu(void)
 {
     unsigned int a, b, c, d;
 
index bf12b8d6a0aa77b912c0d3f44eb786d806a0c6af..799d7005baa14cfac8160432f31723e7110200c2 100644 (file)
@@ -70,7 +70,7 @@
 
 #define HMAC_CTX_new compat_hmac_ctx_new
 static HMAC_CTX *
-compat_hmac_ctx_new()
+compat_hmac_ctx_new(void)
 {
     HMAC_CTX *ctx;
 
index 6d103a00d1588fe6024eabb1560fea5f2bbb4d15..0f94e823cb6bd5aae472d5f8c56a6ac4f78aa983 100644 (file)
@@ -85,7 +85,7 @@ krb5_creds test_creds = {
 };
 
 void
-init_test_cred()
+init_test_cred(void)
 {
     test_creds.client = (krb5_principal) malloc(sizeof(krb5_data *)*3);
     test_creds.client[0] = &client1;
@@ -104,7 +104,7 @@ init_test_cred()
     };
 
 void
-mcc_test()
+mcc_test(void)
 {
     krb5_ccache id;
     krb5_creds creds;
index 15185e301cad3dba84fcaef3ef8f79f8c266f382..06a9c2dea14e2e1fd67d072e6ee579024b164172 100644 (file)
@@ -98,7 +98,7 @@ krb5_creds test_creds = {
 };
 
 void
-init_test_cred()
+init_test_cred(void)
 {
     test_creds.client = (krb5_principal) malloc(sizeof(krb5_data *)*3);
     test_creds.client[0] = &client1;
@@ -118,7 +118,7 @@ init_test_cred()
 
 int flags = 0;
 void
-scc_test()
+scc_test(void)
 {
     krb5_ccache id;
     krb5_creds creds;
index bc71076a352a492841ff2aaee73e197aa04f32b4..5a955e09be92682b702949fd40a077f22f481b5c 100644 (file)
@@ -56,7 +56,7 @@ static FILE *tracefp;
  *     initialize debugging.
  */
 static void
-__bt_dinit()
+__bt_dinit(void)
 {
        static int first = 1;
 
index 0bb19d711acfadc1899e513e636bf6e51cbd6e2d..56bab194127d6eeb4f9a72be0d28311369e05bf4 100644 (file)
@@ -390,7 +390,7 @@ nroot(BTREE *t)
 }
 
 static int
-tmp()
+tmp(void)
 {
 #ifdef SIG_BLOCK
        sigset_t set, oset;
@@ -437,7 +437,7 @@ tmp()
 }
 
 static int
-byteorder()
+byteorder(void)
 {
        u_int32_t x;
        u_char *p;
index 2dca256dc3fdb335fc1f80ffaaba1cdb364619cb..e643634433df607a65dd53cb7285dfa584f466f2 100644 (file)
@@ -143,7 +143,7 @@ kdb2_store(datum key, datum dat)
 }
 
 static void
-no_open_db()
+no_open_db(void)
 {
        (void)fprintf(stderr, "dbm: no open database.\n");
 }
index 088f903231398145e0239e6b310f9323b454a976..eec843d4dbbd2fcd31571bdc61e641ae2b12939c 100644 (file)
@@ -908,7 +908,7 @@ keydata(key, data)
 }
 
 void
-usage()
+usage(void)
 {
        (void)fprintf(stderr,
            "usage: %s [-bdluw] [-c cache] [-i file] [-p page] [file]\n",
index 04bf34b90d2bee45984ab34c40b889841fdfb916..a2866b4412536c678d907d17eaedc822f3780021 100644 (file)
@@ -792,7 +792,7 @@ xmalloc(char *text, size_t len)
 }
 
 void
-usage()
+usage(void)
 {
        (void)fprintf(stderr,
            "usage: dbtest [-l] [-f file] [-i info] [-o file] type script\n");
index 7c26899fa7700875103c01eb364a1a6d9b4cc9e9..4dcbeb38b60089a229a291f0241c0c4efc5c8479 100644 (file)
@@ -3119,7 +3119,7 @@ cleanup:
 }
 
 int
-pkinit_openssl_init()
+pkinit_openssl_init(void)
 {
     /* Initialize OpenSSL. */
     ERR_load_crypto_strings();
index 99fda7ffcd8c184e7213a04366d7fcc95c159f14..aab67c01cbc695348576655a1ce681b4bdb33995 100644 (file)
@@ -49,7 +49,7 @@ static int ex_handle_id = -1;
 MAKE_INIT_FUNCTION(init_openssl);
 
 int
-init_openssl()
+init_openssl(void)
 {
     SSL_library_init();
     SSL_load_error_strings();
index 2fc85466bbd01dc041bcb8b55245a41674aa178e..6f2b7dd0219d4d644a82cb8f29e99d28e15ebfe0 100644 (file)
@@ -224,7 +224,7 @@ printbuf(void)
 }
 
 int
-main()
+main(void)
 {
     /* Initialize values which can't use static initializers. */
     asn_long2INTEGER(&otp_format, 2);  /* Alphanumeric */