krb5 commit: Eliminate old-style function declarations

ghudson at mit.edu ghudson at mit.edu
Mon Jul 24 11:06:03 EDT 2023


https://github.com/krb5/krb5/commit/4b9d7f7c107f01a61600fddcd8cde3812d0366a2
commit 4b9d7f7c107f01a61600fddcd8cde3812d0366a2
Author: Ken Hornstein <kenh at cmf.nrl.navy.mil>
Date:   Fri Jun 9 23:53:53 2023 -0400

    Eliminate old-style function declarations
    
    The C2x standard removes support for non-prototype function
    declarations, and clang 15 issues warnings for them
    (https://reviews.llvm.org/D122895).  Add -Werror=strict-prototypes to
    the build and fix all of the non-prototype declarations and
    definitions.
    
    For RPC code, try to be consistent with libtirpc and recent *BSD
    versions of rpcgen.  This includes casting each time a concrete
    function is used as an xdrproc_t value, since each XDR per-type
    function accepts a different object pointer type.  A few invocations
    of xdrproc_t values pass a third argument with value LASTUNSIGNED,
    even though XDR per-type functions accept only two parameters.
    libtirpc has removed these third arguments; do so here as well.
    
    [ghudson at mit.edu: added -Werror=strict-prototypes and fixed
    declarations it breaks under gcc and clang; added xdrproc_t changes;
    rewrote commit message; style changes]

 src/aclocal.m4                                     |   2 +-
 src/appl/gss-sample/gss-client.c                   |  29 +---
 src/appl/gss-sample/gss-misc.c                     |  26 +---
 src/appl/gss-sample/gss-server.c                   |   2 +-
 src/appl/user_user/server.c                        |   5 +-
 src/clients/kdestroy/kdestroy.c                    |   2 +-
 src/clients/kinit/kinit.c                          |   4 +-
 src/clients/klist/klist.c                          |   2 +-
 src/clients/ksu/authorization.c                    |  95 +++++-------
 src/clients/ksu/ccache.c                           | 108 +++++---------
 src/clients/ksu/heuristic.c                        |  94 ++++--------
 src/clients/ksu/krb_auth_su.c                      |  49 +++----
 src/clients/ksu/main.c                             |  40 ++---
 src/clients/kvno/kvno.c                            |   2 +-
 src/include/gssrpc/auth_gssapi.h                   |  10 +-
 src/include/gssrpc/xdr.h                           |   3 +-
 src/include/k5-int.h                               |   2 +-
 src/include/k5-plugin.h                            |   2 +-
 src/include/net-server.h                           |   6 +-
 src/kadmin/cli/getdate.y                           |   3 -
 src/kadmin/cli/kadmin.c                            |   6 +-
 src/kadmin/cli/keytab.c                            |   4 +-
 src/kadmin/dbutil/kdb5_create.c                    |  16 +-
 src/kadmin/dbutil/kdb5_destroy.c                   |   4 +-
 src/kadmin/dbutil/kdb5_stash.c                     |   4 +-
 src/kadmin/dbutil/kdb5_util.c                      |  24 +--
 src/kadmin/dbutil/ovload.c                         |  14 +-
 src/kadmin/dbutil/strtok.c                         |   4 +-
 src/kadmin/ktutil/ktutil.c                         |  45 +++---
 src/kadmin/ktutil/ktutil_funcs.c                   |  37 ++---
 src/kadmin/server/ipropd_svc.c                     |  24 +--
 src/kadmin/server/kadm_rpc_svc.c                   | 162 ++++++++++-----------
 src/kadmin/server/ovsec_kadmd.c                    |   4 +-
 src/kdc/t_ndr.c                                    |   2 +-
 src/kdc/t_replay.c                                 |   6 +-
 src/kprop/kpropd.c                                 |   2 +-
 src/kprop/kproplog.c                               |   4 +-
 src/lib/apputils/net-server.c                      |   7 +-
 src/lib/crypto/builtin/aes/aes-gen.c               |  18 ++-
 src/lib/crypto/builtin/camellia/camellia-gen.c     |  18 ++-
 src/lib/crypto/builtin/des/des_int.h               |   3 -
 src/lib/crypto/builtin/des/destest.c               |  21 +--
 src/lib/crypto/builtin/des/t_verify.c              |  15 +-
 src/lib/crypto/builtin/sha1/t_shs.c                |   7 +-
 src/lib/crypto/builtin/sha1/t_shs3.c               |   7 +-
 src/lib/crypto/crypto_tests/aes-test.c             |   8 +-
 src/lib/crypto/crypto_tests/camellia-test.c        |   8 +-
 src/lib/crypto/crypto_tests/t_cf2.c                |   4 +-
 src/lib/crypto/crypto_tests/t_cts.c                |   2 +-
 src/lib/crypto/crypto_tests/t_encrypt.c            |   2 +-
 src/lib/crypto/crypto_tests/t_fork.c               |   2 +-
 src/lib/crypto/crypto_tests/t_hmac.c               |   3 +-
 src/lib/crypto/crypto_tests/t_mddriver.c           |  25 ++--
 src/lib/crypto/crypto_tests/t_nfold.c              |  16 +-
 src/lib/crypto/crypto_tests/t_prf.c                |   2 +-
 src/lib/crypto/crypto_tests/t_sha2.c               |   2 +-
 src/lib/gssapi/generic/t_seqstate.c                |   2 +-
 src/lib/gssapi/krb5/accept_sec_context.c           |  76 +++-------
 src/lib/gssapi/krb5/compare_name.c                 |   7 +-
 src/lib/gssapi/krb5/context_time.c                 |   6 +-
 src/lib/gssapi/krb5/delete_sec_context.c           |   7 +-
 src/lib/gssapi/krb5/disp_name.c                    |   9 +-
 src/lib/gssapi/krb5/disp_status.c                  |  11 +-
 src/lib/gssapi/krb5/export_sec_context.c           |   7 +-
 src/lib/gssapi/krb5/gssapi_krb5.c                  |   4 +-
 src/lib/gssapi/krb5/import_name.c                  |   8 +-
 src/lib/gssapi/krb5/import_sec_context.c           |  10 +-
 src/lib/gssapi/krb5/indicate_mechs.c               |   4 +-
 src/lib/gssapi/krb5/init_sec_context.c             |  55 +++----
 src/lib/gssapi/krb5/inq_context.c                  |  17 +--
 src/lib/gssapi/krb5/inq_cred.c                     |  26 +---
 src/lib/gssapi/krb5/inq_names.c                    |   6 +-
 src/lib/gssapi/krb5/k5seal.c                       |  38 ++---
 src/lib/gssapi/krb5/k5unseal.c                     |  51 ++-----
 src/lib/gssapi/krb5/process_context_token.c        |   8 +-
 src/lib/gssapi/krb5/rel_cred.c                     |   4 +-
 src/lib/gssapi/krb5/rel_name.c                     |   4 +-
 src/lib/gssapi/krb5/rel_oid.c                      |   8 +-
 src/lib/gssapi/krb5/ser_sctx.c                     |  16 +-
 src/lib/gssapi/krb5/util_cksum.c                   |   6 +-
 src/lib/gssapi/krb5/util_seed.c                    |   5 +-
 src/lib/gssapi/krb5/util_seqnum.c                  |  19 +--
 src/lib/gssapi/krb5/val_cred.c                     |   4 +-
 src/lib/gssapi/krb5/wrap_size_limit.c              |  11 +-
 src/lib/gssapi/mechglue/g_accept_sec_context.c     |  31 +---
 src/lib/gssapi/mechglue/g_acquire_cred.c           |  95 +++---------
 src/lib/gssapi/mechglue/g_acquire_cred_with_pw.c   |  56 +++----
 src/lib/gssapi/mechglue/g_canon_name.c             |  10 +-
 src/lib/gssapi/mechglue/g_compare_name.c           |  12 +-
 src/lib/gssapi/mechglue/g_context_time.c           |  10 +-
 src/lib/gssapi/mechglue/g_delete_sec_context.c     |  10 +-
 src/lib/gssapi/mechglue/g_dsp_name.c               |  12 +-
 src/lib/gssapi/mechglue/g_dsp_status.c             |  22 +--
 src/lib/gssapi/mechglue/g_dup_name.c               |   8 +-
 src/lib/gssapi/mechglue/g_exp_sec_context.c        |  10 +-
 src/lib/gssapi/mechglue/g_export_name.c            |   8 +-
 src/lib/gssapi/mechglue/g_glue.c                   |  75 ++++------
 src/lib/gssapi/mechglue/g_imp_name.c               |  18 +--
 src/lib/gssapi/mechglue/g_imp_sec_context.c        |  11 +-
 src/lib/gssapi/mechglue/g_init_sec_context.c       |  37 ++---
 src/lib/gssapi/mechglue/g_initialize.c             |  22 ++-
 src/lib/gssapi/mechglue/g_inq_cred.c               |  31 +---
 src/lib/gssapi/mechglue/g_inq_names.c              |   8 +-
 src/lib/gssapi/mechglue/g_mechname.c               |  14 +-
 src/lib/gssapi/mechglue/g_oid_ops.c                |  27 +---
 src/lib/gssapi/mechglue/g_process_context.c        |  10 +-
 src/lib/gssapi/mechglue/g_rel_buffer.c             |   6 +-
 src/lib/gssapi/mechglue/g_rel_cred.c               |   7 +-
 src/lib/gssapi/mechglue/g_rel_name.c               |   7 +-
 src/lib/gssapi/mechglue/g_rel_oid_set.c            |   6 +-
 src/lib/gssapi/mechglue/g_sign.c                   |  29 +---
 src/lib/gssapi/mechglue/g_store_cred.c             |  48 ++----
 src/lib/gssapi/mechglue/g_unseal.c                 |  35 +----
 src/lib/gssapi/mechglue/g_unwrap_aead.c            |  19 +--
 src/lib/gssapi/mechglue/g_unwrap_iov.c             |  15 +-
 src/lib/gssapi/mechglue/g_verify.c                 |  30 +---
 src/lib/gssapi/mechglue/g_wrap_aead.c              |  39 ++---
 src/lib/gssapi/mechglue/g_wrap_iov.c               |  43 ++----
 src/lib/kadm5/clnt/client_rpc.c                    |   1 +
 src/lib/kadm5/kadm_rpc.h                           |  45 ------
 src/lib/kadm5/kadm_rpc_xdr.c                       |  37 +++--
 src/lib/kadm5/misc_free.c                          |   5 +-
 src/lib/kadm5/srv/adb_xdr.c                        |   6 +-
 src/lib/kadm5/srv/svr_principal.c                  |  12 +-
 src/lib/kadm5/str_conv.c                           |  18 +--
 src/lib/kadm5/t_kadm5.c                            |  22 +--
 src/lib/kdb/kdb5.c                                 |   8 +-
 src/lib/kdb/kdb_cpw.c                              |  32 +---
 src/lib/kdb/keytab.c                               |  19 +--
 src/lib/kdb/t_stringattr.c                         |   2 +-
 src/lib/krad/packet.c                              |   2 +-
 src/lib/krad/t_attr.c                              |   2 +-
 src/lib/krad/t_attrset.c                           |   2 +-
 src/lib/krad/t_code.c                              |   2 +-
 src/lib/krb5/ccache/cc_keyring.c                   |   2 +-
 src/lib/krb5/krb/plugin.c                          |   2 +-
 src/lib/krb5/krb/t_authdata.c                      |   2 +-
 src/lib/krb5/krb/t_response_items.c                |   2 +-
 src/lib/krb5/krb/t_ser.c                           |   8 +-
 src/lib/krb5/krb/t_sname_match.c                   |   2 +-
 src/lib/krb5/krb/t_valid_times.c                   |   2 +-
 src/lib/krb5/rcache/t_memrcache.c                  |   2 +-
 src/lib/rpc/auth_gss.c                             |   4 +-
 src/lib/rpc/auth_gssapi.c                          |  14 +-
 src/lib/rpc/auth_gssapi_misc.c                     |   4 +-
 src/lib/rpc/authunix_prot.c                        |   3 +-
 src/lib/rpc/clnt_perror.c                          |   1 -
 src/lib/rpc/clnt_raw.c                             |   2 +-
 src/lib/rpc/dyn.c                                  |  85 +++++------
 src/lib/rpc/pmap_clnt.c                            |   9 +-
 src/lib/rpc/pmap_getmaps.c                         |   5 +-
 src/lib/rpc/pmap_getport.c                         |   6 +-
 src/lib/rpc/pmap_prot2.c                           |   3 +-
 src/lib/rpc/pmap_rmt.c                             |  10 +-
 src/lib/rpc/rpc_prot.c                             |   4 +-
 src/lib/rpc/svc.c                                  |   4 +-
 src/lib/rpc/svc_auth_gss.c                         |  10 +-
 src/lib/rpc/svc_auth_gssapi.c                      |  28 ++--
 src/lib/rpc/svc_simple.c                           |   4 +-
 src/lib/rpc/unit-test/client.c                     |  18 +--
 src/lib/rpc/unit-test/rpc_test_clnt.c              |   4 +-
 src/lib/rpc/unit-test/rpc_test_svc.c               |  16 +-
 src/lib/rpc/unit-test/server.c                     |   2 +-
 src/lib/rpc/xdr.c                                  |   4 +-
 src/lib/rpc/xdr_array.c                            |   4 +-
 src/lib/rpc/xdr_rec.c                              |  13 +-
 src/lib/rpc/xdr_reference.c                        |   4 +-
 src/lib/rpc/xdr_sizeof.c                           |  29 +---
 src/plugins/kdb/db2/db2_exp.c                      |   4 +-
 src/plugins/kdb/db2/libdb2/btree/bt_close.c        |  10 +-
 src/plugins/kdb/db2/libdb2/btree/bt_conv.c         |  13 +-
 src/plugins/kdb/db2/libdb2/btree/bt_delete.c       |  34 +----
 src/plugins/kdb/db2/libdb2/btree/bt_get.c          |   6 +-
 src/plugins/kdb/db2/libdb2/btree/bt_open.c         |  12 +-
 src/plugins/kdb/db2/libdb2/btree/bt_overflow.c     |  16 +-
 src/plugins/kdb/db2/libdb2/btree/bt_page.c         |   8 +-
 src/plugins/kdb/db2/libdb2/btree/bt_put.c          |  11 +-
 src/plugins/kdb/db2/libdb2/btree/bt_search.c       |  17 +--
 src/plugins/kdb/db2/libdb2/btree/bt_seq.c          |  27 +---
 src/plugins/kdb/db2/libdb2/btree/bt_split.c        |  42 ++----
 src/plugins/kdb/db2/libdb2/btree/bt_utils.c        |  18 +--
 src/plugins/kdb/db2/libdb2/db/db.c                 |  26 ++--
 src/plugins/kdb/db2/libdb2/hash/dbm.c              |  50 ++-----
 src/plugins/kdb/db2/libdb2/hash/hash.c             |  94 +++---------
 src/plugins/kdb/db2/libdb2/hash/hash_bigkey.c      |  35 +----
 src/plugins/kdb/db2/libdb2/hash/hash_func.c        |  16 +-
 src/plugins/kdb/db2/libdb2/hash/hash_log2.c        |   3 +-
 src/plugins/kdb/db2/libdb2/hash/hash_page.c        | 121 ++++-----------
 src/plugins/kdb/db2/libdb2/hash/hsearch.c          |   9 +-
 src/plugins/kdb/db2/libdb2/mpool/mpool.c           |  54 ++-----
 src/plugins/kdb/db2/libdb2/recno/rec_close.c       |   7 +-
 src/plugins/kdb/db2/libdb2/recno/rec_delete.c      |  14 +-
 src/plugins/kdb/db2/libdb2/recno/rec_get.c         |  22 +--
 src/plugins/kdb/db2/libdb2/recno/rec_open.c        |   9 +-
 src/plugins/kdb/db2/libdb2/recno/rec_put.c         |  12 +-
 src/plugins/kdb/db2/libdb2/recno/rec_search.c      |   5 +-
 src/plugins/kdb/db2/libdb2/recno/rec_seq.c         |   5 +-
 src/plugins/kdb/db2/libdb2/recno/rec_utils.c       |   6 +-
 src/plugins/kdb/db2/libdb2/test/dbtest.c           |  59 ++------
 src/plugins/kdb/db2/pol_xdr.c                      |   2 +-
 src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.c    |   4 +-
 src/plugins/kdb/lmdb/kdb_lmdb.c                    |   4 +-
 src/plugins/kdb/test/kdb_test.c                    |   4 +-
 src/plugins/preauth/pkinit/pkinit_crypto_openssl.c |   4 +-
 src/plugins/preauth/spake/t_vectors.c              |   2 +-
 src/tests/asn.1/krb5_decode_test.c                 |   5 +-
 src/tests/asn.1/krb5_encode_test.c                 |  13 +-
 src/tests/asn.1/t_trval.c                          |  14 +-
 src/tests/asn.1/trval.c                            |  73 +++-------
 src/tests/conccache.c                              |   4 +-
 src/tests/create/kdb5_mkdums.c                     |  16 +-
 src/tests/forward.c                                |   2 +-
 src/tests/gss-threads/gss-client.c                 |   4 +-
 src/tests/gss-threads/gss-server.c                 |   2 +-
 src/tests/gssapi/reload.c                          |   2 +-
 src/tests/gssapi/t_add_cred.c                      |   2 +-
 src/tests/gssapi/t_enctypes.c                      |   2 +-
 src/tests/gssapi/t_invalid.c                       |   4 +-
 src/tests/gssapi/t_oid.c                           |   2 +-
 src/tests/gssapi/t_spnego.c                        |   2 +-
 src/tests/hammer/kdc5_hammer.c                     |  36 ++---
 src/tests/kdbtest.c                                |   2 +-
 src/tests/misc/test_getpw.c                        |   2 +-
 src/tests/plugorder.c                              |   2 +-
 src/tests/shlib/t_loader.c                         |   2 +-
 src/tests/softpkcs11/main.c                        |   2 +-
 src/tests/t_inetd.c                                |   7 +-
 src/tests/test1.c                                  |   4 +-
 src/tests/verify/kdb5_verify.c                     |  17 +--
 src/util/et/error_message.c                        |   2 +-
 src/util/et/test_et.c                              |   3 +-
 src/util/profile/prof_init.c                       |   2 +-
 src/util/profile/t_profile.c                       |  22 +--
 src/util/profile/test_load.c                       |   2 +-
 src/util/profile/test_parse.c                      |   5 +-
 src/util/profile/test_profile.c                    |  10 +-
 src/util/profile/test_vtable.c                     |   3 +-
 src/util/ss/error.c                                |  13 +-
 src/util/ss/execute_cmd.c                          |  23 +--
 src/util/ss/help.c                                 | 115 +++++++--------
 src/util/ss/invocation.c                           |  13 +-
 src/util/ss/list_rqs.c                             |  11 +-
 src/util/ss/listen.c                               |  32 ++--
 src/util/ss/pager.c                                |  10 +-
 src/util/ss/parse.c                                |   6 +-
 src/util/ss/prompt.c                               |   7 +-
 src/util/ss/request_tbl.c                          |  11 +-
 src/util/ss/requests.c                             |   2 +-
 src/util/ss/ss.h                                   |   1 -
 src/util/ss/ss_internal.h                          |   3 +-
 src/util/support/plugins.c                         |  10 +-
 src/util/support/t_hashtab.c                       |   6 +-
 src/util/support/t_hex.c                           |   3 +-
 src/util/support/t_json.c                          |   2 +-
 src/util/support/t_k5buf.c                         |  16 +-
 src/util/support/t_unal.c                          |   3 +-
 256 files changed, 1390 insertions(+), 2747 deletions(-)

Diff larger than 5000 lines; suppressing.


More information about the cvs-krb5 mailing list