Originally Posted by NMTop40
pointers to functions don't have to be the same size as pointers to data. That is why it is undefined behaviour to cast a pointer to a function to void* and vice-versa.
Note therefore that you should not use dlsym() to get a pointer to a function, but instead get your shared-object libraries to always return pointers to objects if you want to be safe (and use them for dynamic loading).
GetProcAddress() is slightly safer in that it returns a more abstract FARPROC handle, which suggests a pointer to a function.