Automatically wrap C/C++ function at compile-time with annotation

In my C/C++ code I want to annotate different functions and methods so that additional code gets added at compile-time (or link-time). The added wrapping code should be able to inspect context (function being called, thread information, etc.), read/write input variables and modify return values and output variables.

How can I do that with GCC and/or Clang?


Source: gcc

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.