IssueRaiser

I'm currently involved in function interposing.

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.

Posted by delinka on Aug 2, 2015, 9:19 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.5,000 issues0 comments

hackernews (Software)

I'm currently involved in function interposing.

delinkaAug 2, 2015, 9:19 PM

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.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue