|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2011-5-5 14:36:08
|
显示全部楼层
确实如此,下面是原文的说明
In a nutshell weak symbols permit you to define a symbol that doesn’t need to be resolved at link time, i.e. it allows you to tell the
compiler that this function may not have a body and that is OK. Furthermore, if later the compiler comes across another symbol with the same
name that doesn’t have the weak attribute the original symbol will be overwritten with the stronger symbol (Without getting a multiple
defination linker error). And finally you can also use the symbol to determine, at run-time, if such a body exists. |
|