Quote 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.
Yes, I did come to know about this in the above mentioned thread. And I posted my latest doubt on that thread only. NMTop40, thanks anyways. You are always informative .