How about instead of assigning to your function pointer directly using `memset`, instead use `dlsym()` to look it up? You could even declare the fnptr to take a `volatile` argument as well as the ptr itself being `volatile` (not sure that is useful here).
Of course, using `dlsym()` isn't exactly portable...
Of course, using `dlsym()` isn't exactly portable...