summaryrefslogtreecommitdiffstats
path: root/crypto/dso/dso_dlfcn.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2009-10-04 14:02:22 +0000
committerDr. Stephen Henson <steve@openssl.org>2009-10-04 14:02:22 +0000
commit9a0c776c605f7dcf70837239fea256ff6d1df663 (patch)
treed6f4b630e4c0727abf57a1c1870d6793b4a5bf02 /crypto/dso/dso_dlfcn.c
parent77db140f94d5608990d35b29d0a04ba98211060a (diff)
Prevent aliasing warning
Diffstat (limited to 'crypto/dso/dso_dlfcn.c')
-rw-r--r--crypto/dso/dso_dlfcn.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/crypto/dso/dso_dlfcn.c b/crypto/dso/dso_dlfcn.c
index ed0b2c80df..7da3f78928 100644
--- a/crypto/dso/dso_dlfcn.c
+++ b/crypto/dso/dso_dlfcn.c
@@ -257,7 +257,10 @@ static void *dlfcn_bind_var(DSO *dso, const char *symname)
static DSO_FUNC_TYPE dlfcn_bind_func(DSO *dso, const char *symname)
{
void *ptr;
- DSO_FUNC_TYPE sym, *tsym = &sym;
+ union {
+ DSO_FUNC_TYPE sym;
+ void *dlret;
+ } u;
if((dso == NULL) || (symname == NULL))
{
@@ -275,14 +278,14 @@ static DSO_FUNC_TYPE dlfcn_bind_func(DSO *dso, const char *symname)
DSOerr(DSO_F_DLFCN_BIND_FUNC,DSO_R_NULL_HANDLE);
return(NULL);
}
- *(void **)(tsym) = dlsym(ptr, symname);
- if(sym == NULL)
+ u.dlret = dlsym(ptr, symname);
+ if(u.dlret == NULL)
{
DSOerr(DSO_F_DLFCN_BIND_FUNC,DSO_R_SYM_FAILURE);
ERR_add_error_data(4, "symname(", symname, "): ", dlerror());
return(NULL);
}
- return(sym);
+ return u.sym;
}
static char *dlfcn_merger(DSO *dso, const char *filespec1,