You can use __builtin_types_compatible_p to compare two types for equality at compile time. Many open sources utilize this to create and utilize many creative macro functions. Since the behavior is determined at compile time, it has the advantage of no runtime overhead, which is very helpful in terms of execution performance.
read more
For debugging or profiling, hooking functions that are called before and after the user function starts and ends can be inserted into the compilation type through the -finstrument-functions gcc option. You can also override this function to have the behavior you want. Insertion of hooking function can also be excluded by using no_instrument_function gcc attribute.
read more
ELF has a Symbol Binding field for symbol management. We can decide whether or not to disclose the symbol to the outside, and we can set this value using the gcc visibility attribute.
read more
gcc provides a constructor that can be executed before the main function and descturtor that can be executed after the main function. If you use it well, you can make a hooking library and use it for debugging, etc.
read more
The format attribute specifies that a function takes printf, scanf, strftime or strfmon style arguments which should be type-checked against a format string.
read more