Skip to content
Snippets Groups Projects
Commit 6bdcfecb authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

Joe Halpin fixed the warning on the typecast from data pointer to function

pointer!
parent 3f21fe60
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment