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 dcfb796..8323b59 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 d155791..47cbdd2 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 b46434c..c6658d7 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 53d7945..22617e5 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 e0709be..954b4d7 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 a7ed0f8..8fecd34 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 8b6647a..765a6c0 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 528689e..e2bc829 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 72859f8..d7b1021 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 167336d..4ebaa1c 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 3da50e8..7e33f14 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 d3d12d2..7f1fc8f 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 12cc486..c5ca1c2 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)