Default Handlers in C: weak_alias

Default Handlers in C: weak_alias function tells the linker that new is to be a weak alias for old. That is, this definition of new is a weak symbol. If there is no other definition of a symbol called new, this old definition stands. Might seems alien to you first, so go through a below example & read again. Definition of weak_alias is as follows : 1 2 #define weak_alias(old, new) \ extern __typeof(old) new __attribute__((weak, alias(#old))) If there is another (non-weak) definition of new then that non-weak(i....

September 15, 2019 · 2 min · 256 words · Vishal Chovatiya