Avoid warnings with -pedantic, specifically:
authorDr. Stephen Henson <steve@openssl.org>
Fri, 4 Jul 2008 23:12:52 +0000 (23:12 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Fri, 4 Jul 2008 23:12:52 +0000 (23:12 +0000)
Conversion between void * and function pointer.
Value computed not used.
Signed/unsigned argument.

13 files changed:
apps/openssl.c
crypto/asn1/ameth_lib.c
crypto/asn1/x_name.c
crypto/conf/conf_api.c
crypto/engine/eng_table.c
crypto/evp/evp_pbe.c
crypto/evp/pmeth_lib.c
crypto/ex_data.c
crypto/mem_dbg.c
crypto/objects/obj_xref.c
crypto/txt_db/txt_db.c
crypto/x509v3/v3_utl.c
ssl/ssl_sess.c

index dcfb796176c57c82ca4618d8add12735323ab7b6..8323b5965959bfc12597cd49b3f7cd0885ff1bff 100644 (file)
@@ -618,7 +618,7 @@ static LHASH_OF(FUNCTION) *prog_init(void)
                return(NULL);
 
        for (f=functions; f->name != NULL; f++)
-               lh_FUNCTION_insert(ret,f);
+               (void)lh_FUNCTION_insert(ret,f);
        return(ret);
        }
 
index d155791324007296de75bcc9220fa2d9ff5ebde0..47cbdd28d0732ed10e305139acd417ce9941bd7d 100644 (file)
@@ -94,7 +94,7 @@ static const EVP_PKEY_ASN1_METHOD *standard_methods[] =
        };
 
 typedef int sk_cmp_fn_type(const char * const *a, const char * const *b);
-DECLARE_STACK_OF(EVP_PKEY_ASN1_METHOD);
+DECLARE_STACK_OF(EVP_PKEY_ASN1_METHOD)
 static STACK_OF(EVP_PKEY_ASN1_METHOD) *app_methods = NULL;
 
 
index b46434c7bd32edf3b725334d1572333b7fdfb276..c6658d7affac55c22589c146973842f9f85f865c 100644 (file)
@@ -64,7 +64,7 @@
 #include "asn1_locl.h"
 
 typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
-DECLARE_STACK_OF(STACK_OF_X509_NAME_ENTRY);
+DECLARE_STACK_OF(STACK_OF_X509_NAME_ENTRY)
 
 static int x509_name_ex_d2i(ASN1_VALUE **val,
                                const unsigned char **in, long len,
index 53d7945da4f813a4dfa70dc7f01aad9eee88b437..22617e5fa18375a327d3d74cf00710163e794ca4 100644 (file)
@@ -241,7 +241,7 @@ void _CONF_free_data(CONF *conf)
 static void value_free_hash_doall_arg(CONF_VALUE *a, LHASH_OF(CONF_VALUE) *conf)
        {
        if (a->name != NULL)
-               lh_CONF_VALUE_delete(conf,a);
+               (void)lh_CONF_VALUE_delete(conf,a);
        }
 
 static void value_free_stack_doall(CONF_VALUE *a)
index e0709bef3643a936b39a67ab0ea9b1c7f3ecc1a0..954b4d79702c6ddb8ee47b906c4b0cef96cc9745 100644 (file)
@@ -157,7 +157,7 @@ int engine_table_register(ENGINE_TABLE **table, ENGINE_CLEANUP_CB *cleanup,
                                goto end;
                                }
                        fnd->funct = NULL;
-                       lh_ENGINE_PILE_insert(&(*table)->piles, fnd);
+                       (void)lh_ENGINE_PILE_insert(&(*table)->piles, fnd);
                        }
                /* A registration shouldn't add duplciate entries */
                (void)sk_ENGINE_delete_ptr(fnd->sk, e);
index a7ed0f84b7b0685fb2943e8ea32001e8efecb284..8fecd34221c3c750daa423ffbcf6d8ce3824664e 100644 (file)
@@ -64,7 +64,7 @@
 
 /* Password based encryption (PBE) functions */
 
-DECLARE_STACK_OF(EVP_PBE_CTL);
+DECLARE_STACK_OF(EVP_PBE_CTL)
 static STACK_OF(EVP_PBE_CTL) *pbe_algs;
 
 /* Setup a cipher context from a PBE algorithm */
index 8b6647a91da8c212e5a3bee9da5c453fe95fb736..765a6c07dbfd125da1dff55d42aca6df89ae96b3 100644 (file)
@@ -69,7 +69,7 @@
 
 typedef int sk_cmp_fn_type(const char * const *a, const char * const *b);
 
-DECLARE_STACK_OF(EVP_PKEY_METHOD);
+DECLARE_STACK_OF(EVP_PKEY_METHOD)
 STACK_OF(EVP_PKEY_METHOD) *app_pkey_methods = NULL;
 
 extern const EVP_PKEY_METHOD rsa_pkey_meth, dh_pkey_meth, dsa_pkey_meth;
index 528689edb5ebe1cd0a1e329d1fd0d0d8f3bbe17a..e2bc8298d0a7a6f1b45e1a3cfe1c7248c00a9919 100644 (file)
@@ -317,7 +317,7 @@ static EX_CLASS_ITEM *def_get_class(int class_index)
                                {
                                /* Because we're inside the ex_data lock, the
                                 * return value from the insert will be NULL */
-                               lh_EX_CLASS_ITEM_insert(ex_data, gen);
+                               (void)lh_EX_CLASS_ITEM_insert(ex_data, gen);
                                p = gen;
                                }
                        }
index 72859f8992d7ba38f5ef9c56ddbadeee236179dc..d7b1021b8c52b81366f09e502f680d4a3275dfff 100644 (file)
@@ -379,7 +379,7 @@ static APP_INFO *pop_info(void)
                        if (next != NULL)
                                {
                                next->references++;
-                               lh_APP_INFO_insert(amih,next);
+                               (void)lh_APP_INFO_insert(amih,next);
                                }
 #ifdef LEVITTE_DEBUG_MEM
                        if (ret->thread_id != tmp.thread_id || ret->thread_idptr != tmp.thread_idptr)
@@ -656,7 +656,7 @@ void CRYPTO_dbg_realloc(void *addr1, void *addr2, int num,
 #endif
                                mp->addr=addr2;
                                mp->num=num;
-                               lh_MEM_insert(mh,mp);
+                               (void)lh_MEM_insert(mh,mp);
                                }
 
                        MemCheck_on(); /* release MALLOC2 lock
@@ -860,18 +860,26 @@ void CRYPTO_mem_leaks_fp(FILE *fp)
 /* NB: The prototypes have been typedef'd to CRYPTO_MEM_LEAK_CB inside crypto.h
  * If this code is restructured, remove the callback type if it is no longer
  * needed. -- Geoff Thorpe */
-static void cb_leak_doall_arg(const MEM *m, CRYPTO_MEM_LEAK_CB *cb)
+
+/* Can't pass CRYPTO_MEM_LEAK_CB directly to lh_MEM_doall_arg because it
+ * is a function pointer and conversion to void * is prohibited. Instead
+ * pass its address
+ */
+
+typedef CRYPTO_MEM_LEAK_CB *PCRYPTO_MEM_LEAK_CB;
+
+static void cb_leak_doall_arg(const MEM *m, PCRYPTO_MEM_LEAK_CB *cb)
        {
-       cb(m->order,m->file,m->line,m->num,m->addr);
+       (*cb)(m->order,m->file,m->line,m->num,m->addr);
        }
 
-static IMPLEMENT_LHASH_DOALL_ARG_FN(cb_leak, const MEM, CRYPTO_MEM_LEAK_CB)
+static IMPLEMENT_LHASH_DOALL_ARG_FN(cb_leak, const MEM, PCRYPTO_MEM_LEAK_CB)
 
 void CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb)
        {
        if (mh == NULL) return;
        CRYPTO_w_lock(CRYPTO_LOCK_MALLOC2);
-       lh_MEM_doall_arg(mh, LHASH_DOALL_ARG_FN(cb_leak), CRYPTO_MEM_LEAK_CB,
-                        cb);
+       lh_MEM_doall_arg(mh, LHASH_DOALL_ARG_FN(cb_leak), PCRYPTO_MEM_LEAK_CB,
+                        &cb);
        CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC2);
        }
index 167336db89d8f0f753f96d5939edd238c9398293..4ebaa1cc6aa9b7676d3fce71c9a0eab8793e331d 100644 (file)
@@ -59,7 +59,7 @@
 #include <openssl/objects.h>
 #include "obj_xref.h"
 
-DECLARE_STACK_OF(nid_triple);
+DECLARE_STACK_OF(nid_triple)
 STACK_OF(nid_triple) *sig_app, *sigx_app;
 
 static int cmp_sig(const nid_triple *a, const nid_triple *b)
index 3da50e86abe5215d0f4baea293f643ab3b64835b..7e33f143cb58c4fcec57fc2a5cff55f11ab9f20c 100644 (file)
@@ -334,7 +334,7 @@ int TXT_DB_insert(TXT_DB *db, STRING *row)
                        {
                        if ((db->qual[i] != NULL) &&
                                (db->qual[i](row) == 0)) continue;
-                       lh_STRING_insert(db->index[i],row);
+                       (void)lh_STRING_insert(db->index[i],row);
                        }
                }
        return(1);
index d3d12d261f27e8acc685222701f246e51dddc74e..7f1fc8fa0bd63ad4d0f773a01d45b88bf0757192 100644 (file)
@@ -554,7 +554,7 @@ static int append_ia5(STACK_OF(STRING) **sk, ASN1_IA5STRING *email)
        if(!*sk) return 0;
        /* Don't add duplicates */
        if(sk_STRING_find(*sk, (char *)email->data) != -1) return 1;
-       emtmp = BUF_strdup(email->data);
+       emtmp = BUF_strdup((char *)email->data);
        if(!emtmp || !sk_STRING_push(*sk, emtmp)) {
                X509_email_free(*sk);
                *sk = NULL;
index 12cc486b1baaa9972c3a68c06eb591d8d4163e92..c5ca1c2014aa5881298669926ee93cbd14184a23 100644 (file)
@@ -847,7 +847,7 @@ static void timeout_doall_arg(SSL_SESSION *s, TIMEOUT_PARAM *p)
                {
                /* The reason we don't call SSL_CTX_remove_session() is to
                 * save on locking overhead */
-               lh_SSL_SESSION_delete(p->cache,s);
+               (void)lh_SSL_SESSION_delete(p->cache,s);
                SSL_SESSION_list_remove(p->ctx,s);
                s->not_resumable=1;
                if (p->ctx->remove_session_cb != NULL)