aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-05-05 14:08:52 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-05-05 14:08:52 +0000
commit6bdcfecbcf587e8ac39d9f6e51b81dcdb361f977 (patch)
treee61ee2d19ae396e83b6f18cc6a2b4600b14bd59a
parent3f21fe60fc5d3662fdfd9165470bf8f51231ef94 (diff)
Joe Halpin fixed the warning on the typecast from data pointer to function
pointer!
-rw-r--r--lib/ldap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ldap.c b/lib/ldap.c
index 223c3fb55..7323788cf 100644
--- a/lib/ldap.c
+++ b/lib/ldap.c
@@ -164,7 +164,11 @@ static dynafunc DynaGetFunction(const char *name)
#if defined(HAVE_DLOPEN) || defined(HAVE_LIBDL)
if (libldap) {
- func = (dynafunc)dlsym(libldap, name);
+ /* This typecast magic below was brought by Joe Halpin. In ISO C, you
+ * cannot typecast a data pointer to a function pointer, but that's
+ * exactly what we need to do here to avoid compiler warnings on picky
+ * compilers! */
+ *(void**) (&func) = dlsym(libldap, name);
}
#elif defined(WIN32)
if (libldap) {