IAR编译警告:the order of volatile accesses is undefined
来源:互联网 发布:淘宝自制摄影棚 编辑:程序博客网 时间:2024/06/06 18:44
转自:http://www.elecbench.com/?p=358
1.问题描述:
在编译代码时出现以下警告。
Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined in this statement
警告处代码如下:
if ((TAR+CcrCont) > TACCR0)
{
return FALSE;
}
警告的意思大体是说,对 volatile 的访问没有被定义。
2.问题分析:
看到 volatile ,才想起以前看过的关于volatile的资料。由于 TAR 是会随时被硬件改变的,所以在使用TAR时应该先拷贝该值到一个临时变量,然后再使用。
所以代码应该修改如下:
u16 Temp = 0;
Temp = TAR;
if ((Temp+CcrCont) > TACCR0)
{
return FALSE;
}
另外,这个报警还提醒了我,我的有些变量应该加上 volatile 关键字。
- IAR编译警告:the order of volatile accesses is undefined
- 【IAR警告】Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined
- IAR编译 Warning[Pa082]:undefined behavior: the order of volatile accesses is undefined in this stateme
- [教你警告消除]Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined。
- Warning[Pa082]:undefined behavior: the order of volatile accesses is undefined in this statement
- undefined behavior: the order of volatile accesses is undefined in this statement
- Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined in this statement
- Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined in this statement
- Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined in this statement
- 【工具】IAR编译出错警告详解
- QT编译警告Z-order assignment: " is not a valid widget.
- The order of life!
- THE ORDER OF MASS
- xcode7.3出现the behavior of the UICollectionViewFlowLayout is not defined警告
- 68.Which statement is true regarding the default behavior of the ORDER BY clause?
- IAR Error[Pe020]: identifier 'FILE' is undefined 解决方法
- IAR编译出现“statement is unreachable”
- Android:Java:编译/运行:提示:The method X is undefined for the type Y
- XML解析DOM和SAX模型对比分析
- 海量数据的解决办法(绝对原创)
- 改进的筛素数法
- JS中遍历函数each的实现
- 策略引擎-jboss Drools Planner
- IAR编译警告:the order of volatile accesses is undefined
- ArrayList、LinkedList和HashSet、TreeSet以及HashMap、TreeMap是如何实现存储的?
- linux网络配置命令
- C++读写文件
- 对于 join, 如果不写 left ,inner ,right ,默认是什么联接呢?
- 外观模式:有序?无序?
- Asterisk命令MeetMe详解
- Win7制作Wi-Fi热点
- android屏幕截图