Bao, Zheng wrote:
I am not quite familiar with the attribute weak. It seems to be a good way.
Normally if two functions have the same name the linker will abort with an error. If one function is weak then it will be removed, and the non-weak function will be used.
It is good and bad. It allows to override a general function easily, but on the other hand it may be difficult to determine which code is actually being used, when many functions have the same name.
//Peter