Fix a gcc-8 warning -Wcast-function-type
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 30 Mar 2018 17:17:39 +0000 (19:17 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Sat, 31 Mar 2018 14:58:06 +0000 (16:58 +0200)
Casting to the generic function type "void (*)(void)"
prevents the warning.

Reviewed-by: Ben Kaduk <kaduk@mit.edu>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
(Merged from https://github.com/openssl/openssl/pull/5816)

test/shlibloadtest.c

index a8cf8e7..aad90e6 100644 (file)
@@ -23,7 +23,7 @@ typedef SSL_CTX * (*SSL_CTX_new_t)(const SSL_METHOD *meth);
 typedef void (*SSL_CTX_free_t)(SSL_CTX *);
 typedef unsigned long (*ERR_get_error_t)(void);
 typedef unsigned long (*OpenSSL_version_num_t)(void);
-typedef DSO * (*DSO_dsobyaddr_t)(void (*addr)(), int flags);
+typedef DSO * (*DSO_dsobyaddr_t)(void (*addr)(void), int flags);
 typedef int (*DSO_free_t)(DSO *dso);
 
 typedef enum test_types_en {
@@ -191,7 +191,7 @@ static int test_lib(void)
         {
             DSO *hndl;
             /* use known symbol from crypto module */
-            if (!TEST_ptr(hndl = myDSO_dsobyaddr((void (*)())ERR_get_error, 0)))
+            if (!TEST_ptr(hndl = myDSO_dsobyaddr((void (*)(void))ERR_get_error, 0)))
                 goto end;
             myDSO_free(hndl);
         }