ADS问题收集:warning:C2207W:inventing (转载)

ADS问题收集:warning:C2207W:inventing (转载)

ADS问题收集:warning:C2207W:inventing (转载)2008年03月24日 星期一 10:38

做了2年多的嵌入式软件,今天才搞明白这问题,哎,失败~

//---------------------------------------
ads1.2下的一个260k的工程文件,
1)对lcd.c文件做了一些修改【添了2个函数,去了几个变量】
2)编译,链接
3)烧到arm板子上,异常,tnnd怎么就加个东西就异常了ni,抓狂!!!!
//---------------------------------------
原来问题tmd在这,无语了!!!!
将全部工程文件选中,对所有工程文件执行一次彻底编译,
呵呵呵呵呵呵,烧到arm上,ok,跑的那是呱呱的~~
//---------------------------------------
现象表述:
选中所有文件执行全部编译的时候,有2个警告提示:
warning:C2207W:inventing 'extern int gliethttp_ini();'
lcd_thread.c line 41

warning:C2207W:inventing 'extern int ucgui2_ReadFlash();'
lcd_thread.c line 45

问题分析:
通过上面的提示,你能看出来问题出在哪儿了吗?...
'extern int gliethttp_ini();'说明因为我自己没有告诉编译器该函数的具体位置,
所以如果不进行一次全面编译,那么该引用处对应的汇编跳转语句将不变,仍是下面的:
[0xeb00b969] bl gliethttp_ini
也就是说向链接后的.bin文件的当前位置向前或向后跳固定的长度不改变,因为没有全部编译,而恰恰向lcd.c添加的那些内容将gliethttp_ini函数的链接地址改变了,或者向后移或者向前移了gliethttp_ini函数编译位置,但是因为没有extern int gliethttp_ini();定义,所以lcd_thread.c函数无从知晓gliethttp_ini函数的链接地址的改变,那么很明显了,lcd_thread.c仍然继续执行下面的机器码
[0xeb00b969] bl gliethttp_ini
向后跳转之后去执行的地址已经不是gliethttp_ini的地址了,所以出现了这么bt的怪现象!

总结:看来要想仅仅修改一个函数,如:lcd.c之后不让程序进行全部编译,
       那么就需要告诉编译器,所有关联了的函数或者全局变量的具体位置【用extern来强制说明】
       也就是让你的编译器在执行全部编译时不要提示“inventing


转载地址:http://hi.baidu.com/cnflycn/item/68b5d036354f4b9cb80c03fc

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
用代码解决这个问题The program committee of the school programming contests, which are often held at the Ural State University, is a big, joyful, and united team. In fact, they are so united that the time spent together at the university is not enough for them, so they often visit each other at their homes. In addition, they are quite athletic and like walking. Once the guardian of the traditions of the sports programming at the Ural State University decided that the members of the program committee spent too much time walking from home to home. They could have spent that time inventing and preparing new problems instead. To prove that, he wanted to calculate the average distance that the members of the program committee walked when they visited each other. The guardian took a map of Yekaterinburg, marked the houses of all the members of the program committee there, and wrote down their coordinates. However, there were so many coordinates that he wasn't able to solve that problem and asked for your help. The city of Yekaterinburg is a rectangle with the sides parallel to the coordinate axes. All the streets stretch from east to west or from north to south through the whole city, from one end to the other. The house of each member of the program committee is located strictly at the intersection of two orthogonal streets. It is known that all the members of the program committee walk only along the streets, because it is more pleasant to walk on sidewalks than on small courtyard paths. Of course, when walking from one house to another, they always choose the shortest way. All the members of the program committee visit each other equally often. Input The first line contains the number n of members of the program committee (2 ≤ n ≤ 105). The i-th of the following n lines contains space-separated coordinates xi, yi of the house of the i-th member of the program committee (1 ≤ xi, yi ≤ 106). All coordinates are integers. Output Output the average distance, rounded down to an integer, that a member of the program committee walks from his house to the house of his colleague.
最新发布
05-26

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值