fun env_get_char_spec() and var env_ptr in u-boot

 in u-boot-1.1.6\common\Env_common.c, fun env_get_char_spec() and var env_ptr in u-boot are externed as followed:

<span style="font-size:18px;">extern env_t *env_ptr;
extern uchar env_get_char_spec(int);</span>
in u-boot, var env_ptr and fun  env_get_char_spec()(and others also)  are defined in many files, such as, env_nand.c, env_nowhere.c and so on(env parameters can be stored in different memory media).

but in the Makefile located at dir u-boot-1.1.6/common, all these file seem to be compiled when compiling u-boot. so the question is which definitions in all these file var env_ptr and fun env_get_char_spec() will refer to?

at start of each such file, there is macro in the conditional compilation statement to control the file contents to be compiled. there is only one macro's value equaling to 1 and only the corresponding file will be compiled.

notices:

1. if there are multilple definitions in several C file in result for executing "go to definition" to a var or fun in Source Insight, you can check at the beginning of this file whether there is a extern for this var or fun. if does, except that special one, other definitions may be disable by a conditional compilation or defined with a attribute of "static".

2. if there are multilple definitions in several C file in result for executing "go to definition" to a macro, in this case, how to find which the only definition this reference uses? you can check these macro definitions in the corresponding files whether the macro value is a static fun, if this, this macro definition is not the target macro definition.






  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值