Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined in this statement
運算符兩邊都是volatile變量的警告
這警告有意義.
用volatile修飾的變量一般不直接參與運算,volatile就以為着這個變量在運算過程中有可能已經改變了
例如:想計算a * b 要這樣:
volatile unsigned char a;
volatile unsigned char b;
unsigned char x,y;
x = a;
y = b;
return (x * y);
建議使用另外一個變量參與計算:
volatile char VVV = 9;
char fun()
{
char xxx;
char yyy = 9;
xxx = VVV;
return xxx * yyy
}