Fix a gcc-8 warning -Wcast-function-type
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Thu, 19 Apr 2018 20:20:29 +0000 (22:20 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 20 Apr 2018 13:54:22 +0000 (15:54 +0200)
Casting to the generic function type "void (*)(void)"
prevents the warning.

Backport of #5816

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6027)

test/shlibloadtest.c

index 919bf7c5f0b33c92286b8bec0f922d3b1d0f2945..d584413ac9be5797186349d040d9752c1d27e79c 100644 (file)
@@ -44,7 +44,7 @@ static OpenSSL_version_num_t OpenSSL_version_num;
 # define DSO_FREE "DSO_free"
 
 typedef void DSO;
-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);
 
 static DSO_dsobyaddr_t DSO_dsobyaddr;
@@ -252,7 +252,7 @@ int main(int argc, char **argv)
         {
             DSO *hndl;
             /* use known symbol from crypto module */
-            if ((hndl = DSO_dsobyaddr((void (*)())ERR_get_error, 0)) != NULL) {
+            if ((hndl = DSO_dsobyaddr((void (*)(void))ERR_get_error, 0)) != NULL) {
                 DSO_free(hndl);
             } else {
                 printf("Unable to obtain DSO reference from crypto symbol\n");