Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined in this statement

来源:互联网 发布:java中cgi是什么 编辑:程序博客网 时间:2024/05/21 11:02

IAR 警告:Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined in this statement

这个警告在运算符两边都有volatile修饰的变量时出现,volatile修饰的变量一般不用于计算

如:

void test_volatile(void)

{

volatile unsigned char a;
volatile unsigned char b;

unsigned char x,y;

x = a;
y = b;

return (x * y);

}

阅读全文
0 0
原创粉丝点击