diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2009-10-04 14:02:35 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2009-10-04 14:02:35 +0000 |
commit | ff095a8ac8096b06a206b76a699311a16805ff86 (patch) | |
tree | 931d5d25c33a195af94bdd770a41fefb9d7afaec /crypto/dso | |
parent | ae37f9f3a224ee9a6f2f14882df7c5ca361cc955 (diff) |
Prevent aliasing warning
Diffstat (limited to 'crypto/dso')
-rw-r--r-- | crypto/dso/dso_dlfcn.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/crypto/dso/dso_dlfcn.c b/crypto/dso/dso_dlfcn.c index 558520d55a..d91e821af6 100644 --- a/crypto/dso/dso_dlfcn.c +++ b/crypto/dso/dso_dlfcn.c @@ -237,7 +237,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)) { @@ -255,14 +258,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, |