3 ms·
I'm currently involved in function interposing. I'm interposing many functions with many different signatures, but I still need some housekeeping for each funct
by delinka 11y ago
I'm currently involved in function interposing. I'm interposing many functions with many different signatures, but I still need some housekeeping for each function that I interpose. The housekeeping struct has pointers for both the original function and the replaced function. These members are necessarily typed as void .
Later, when I want to call the original function, I assign to a properly typed variable to the value of the void original_function member. The compiler has no way to know if that void * is actually FILE (fopen )(char , char ) or if it's int(open )(char , int, ...).
When everything can be properly typed, I only ever get warnings about assigning the wrong function types to the wrong function pointer variables.