C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Interceptor Function

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Tue, 14 Apr 2026 15:56:59 +0200
Those are now 4 different approaches:    - Linker: Redirecting symbols at link time  - Compiler: Adding code to function calls (callsite)  - Compiler: Redirecting functions to a wrapper at compile time  - Compiler: Adding code to the beginning and end of functions themselves (each return, each exception or those not)   Some of those approaches work with compiled caller, some not. Some of those approaches work with compiled callee, some not. Some of those approaches work with inlined functions some not.     -----Ursprüngliche Nachricht----- Von:Zhao YunShan via Std-Proposals <std-proposals_at_[hidden]> Gesendet:Di 14.04.2026 15:31 Betreff:Re: [std-proposals] Interceptor Function An:std-proposals_at_[hidden]; CC:Zhao YunShan <dou1984_at_[hidden]>;  First, replacing function  symbol  at link time is a proven approach; g++ --wrap has been doing this for years. Promoting this compiler flag feature to a native language feature would enhance code readability and make it effortless for developers to apply. Why not do it?  Second, it would be even better if the compiler could handle function symbol replacement directly.  

Received on 2026-04-14 13:58:25