Changeset fd82e59 in mod_gnutls for src/gnutls_config.c


Ignore:
Timestamp:
Feb 27, 2014, 2:26:26 AM (6 years ago)
Author:
Daniel Kahn Gillmor <dkg@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, upstream
Children:
c32240f
Parents:
8a30d35
Message:

use strict compiler arguments by default (-Wall -Werror -Wextra)

Because apache modules make heavy use of generic hooks that have to
have arguments that cover every corner use case, and we don't need all
that data, many mod_gnutls functions have unused parameters, which
have now been explicitly designated as unused.

We also have at least one generic function signature declared for our
interaction with GnuTLS as well, and we aren't using some of those
parameters either.

A useful future review might be to read up on how the unused
parameters are used by other apache modules or users of GnuTLS, to see
if we might gather useful ideas.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_config.c

    r8a30d35 rfd82e59  
    5858}
    5959
    60 const char *mgs_set_dh_file(cmd_parms * parms, void *dummy,
     60const char *mgs_set_dh_file(cmd_parms * parms, void *dummy __attribute__((unused)),
    6161        const char *arg) {
    6262    int ret;
     
    101101}
    102102
    103 const char *mgs_set_cert_file(cmd_parms * parms, void *dummy, const char *arg) {
     103const char *mgs_set_cert_file(cmd_parms * parms, void *dummy __attribute__((unused)), const char *arg) {
    104104
    105105    int ret;
     
    130130}
    131131
    132 const char *mgs_set_key_file(cmd_parms * parms, void *dummy, const char *arg) {
     132const char *mgs_set_key_file(cmd_parms * parms, void *dummy __attribute__((unused)), const char *arg) {
    133133
    134134    int ret;
     
    174174}
    175175
    176 const char *mgs_set_pgpcert_file(cmd_parms * parms, void *dummy,
     176const char *mgs_set_pgpcert_file(cmd_parms * parms, void *dummy __attribute__((unused)),
    177177        const char *arg) {
    178178    int ret;
     
    214214}
    215215
    216 const char *mgs_set_pgpkey_file(cmd_parms * parms, void *dummy,
     216const char *mgs_set_pgpkey_file(cmd_parms * parms, void *dummy __attribute__((unused)),
    217217        const char *arg) {
    218218    int ret;
     
    255255}
    256256
    257 const char *mgs_set_tickets(cmd_parms * parms, void *dummy,
     257const char *mgs_set_tickets(cmd_parms * parms, void *dummy __attribute__((unused)),
    258258        const char *arg) {
    259259    mgs_srvconf_rec *sc =
     
    273273#ifdef ENABLE_SRP
    274274
    275 const char *mgs_set_srp_tpasswd_file(cmd_parms * parms, void *dummy,
     275const char *mgs_set_srp_tpasswd_file(cmd_parms * parms, void *dummy __attribute__((unused)),
    276276        const char *arg) {
    277277    mgs_srvconf_rec *sc =
     
    285285}
    286286
    287 const char *mgs_set_srp_tpasswd_conf_file(cmd_parms * parms, void *dummy,
     287const char *mgs_set_srp_tpasswd_conf_file(cmd_parms * parms, void *dummy __attribute__((unused)),
    288288        const char *arg) {
    289289    mgs_srvconf_rec *sc =
     
    300300#endif
    301301
    302 const char *mgs_set_cache(cmd_parms * parms, void *dummy,
     302const char *mgs_set_cache(cmd_parms * parms, void *dummy __attribute__((unused)),
    303303        const char *type, const char *arg) {
    304304    const char *err;
     
    342342}
    343343
    344 const char *mgs_set_cache_timeout(cmd_parms * parms, void *dummy,
     344const char *mgs_set_cache_timeout(cmd_parms * parms, void *dummy __attribute__((unused)),
    345345        const char *arg) {
    346346    int argint;
     
    368368}
    369369
    370 const char *mgs_set_client_verify_method(cmd_parms * parms, void *dummy,
     370const char *mgs_set_client_verify_method(cmd_parms * parms, void *dummy __attribute__((unused)),
    371371        const char *arg) {
    372372    mgs_srvconf_rec *sc = (mgs_srvconf_rec *)ap_get_module_config(parms->server->module_config, &gnutls_module);
     
    387387}
    388388
    389 const char *mgs_set_client_verify(cmd_parms * parms, void *dummy,
    390         const char *arg) {
     389const char *mgs_set_client_verify(cmd_parms * parms,
     390                                  void *dirconf,
     391                                  const char *arg) {
    391392    int mode;
    392393
     
    404405    /* This was set from a directory context */
    405406    if (parms->path) {
    406         mgs_dirconf_rec *dc = (mgs_dirconf_rec *) dummy;
     407        mgs_dirconf_rec *dc = (mgs_dirconf_rec *) dirconf;
    407408        dc->client_verify_mode = mode;
    408409    } else {
     
    419420#define INIT_CA_SIZE 128
    420421
    421 const char *mgs_set_client_ca_file(cmd_parms * parms, void *dummy,
     422const char *mgs_set_client_ca_file(cmd_parms * parms, void *dummy __attribute__((unused)),
    422423        const char *arg) {
    423424    int rv;
     
    481482}
    482483
    483 const char *mgs_set_keyring_file(cmd_parms * parms, void *dummy,
     484const char *mgs_set_keyring_file(cmd_parms * parms, void *dummy __attribute__((unused)),
    484485        const char *arg) {
    485486    int rv;
     
    521522}
    522523
    523 const char *mgs_set_proxy_engine(cmd_parms * parms, void *dummy,
     524const char *mgs_set_proxy_engine(cmd_parms * parms, void *dummy __attribute__((unused)),
    524525        const char *arg) {
    525526
     
    538539}
    539540
    540 const char *mgs_set_enabled(cmd_parms * parms, void *dummy,
     541const char *mgs_set_enabled(cmd_parms * parms, void *dummy __attribute__((unused)),
    541542        const char *arg) {
    542543    mgs_srvconf_rec *sc =
     
    555556}
    556557
    557 const char *mgs_set_export_certificates_size(cmd_parms * parms, void *dummy, const char *arg) {
     558const char *mgs_set_export_certificates_size(cmd_parms * parms, void *dummy __attribute__((unused)), const char *arg) {
    558559    mgs_srvconf_rec *sc = (mgs_srvconf_rec *) ap_get_module_config(parms->server->module_config, &gnutls_module);
    559560    if (!strcasecmp(arg, "On")) {
     
    577578}
    578579
    579 const char *mgs_set_priorities(cmd_parms * parms, void *dummy, const char *arg) {
     580const char *mgs_set_priorities(cmd_parms * parms, void *dummy __attribute__((unused)), const char *arg) {
    580581
    581582        int ret;
     
    656657}
    657658
    658 void *mgs_config_server_create(apr_pool_t * p, server_rec * s) {
     659void *mgs_config_server_create(apr_pool_t * p,
     660                               server_rec * s __attribute__((unused))) {
    659661    char *err = NULL;
    660662    mgs_srvconf_rec *sc = _mgs_config_server_create(p, &err);
     
    715717#undef gnutls_srvconf_assign
    716718
    717 void *mgs_config_dir_merge(apr_pool_t * p, void *basev, void *addv) {
     719void *mgs_config_dir_merge(apr_pool_t * p,
     720                           void *basev __attribute__((unused)),
     721                           void *addv __attribute__((unused))) {
    718722    mgs_dirconf_rec *new;
    719723    /*    mgs_dirconf_rec *base = (mgs_dirconf_rec *) basev; */
     
    725729}
    726730
    727 void *mgs_config_dir_create(apr_pool_t * p, char *dir) {
     731void *mgs_config_dir_create(apr_pool_t * p,
     732                            char *dir __attribute__((unused))) {
    728733    mgs_dirconf_rec *dc = apr_palloc(p, sizeof (*dc));
    729734    dc->client_verify_mode = -1;
Note: See TracChangeset for help on using the changeset viewer.