欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

專注電子技術(shù)學(xué)習(xí)與研究
當(dāng)前位置:單片機(jī)教程網(wǎng) >> MCU設(shè)計(jì)實(shí)例 >> 瀏覽文章

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

作者:未知   來源:Levi之家的空間   點(diǎn)擊數(shù):  更新時間:2014年08月16日   【字體:

IAR編譯的時候,出現(xiàn)警告如下:

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
EW targets: All
EW component: C/C++ compiler
Keywords: C code, keywords, SFR, UART
Last update: January 14, 2009

Background
The warning [Pa082] is issued if 2 (or more) of the variables in a C-statment are volatile. The message text "...order of volatile accesses is undefined..." is the central information, i.e. the compiler (following the ANSII standard) can access the variables in an order that is not defined.

Is this a problem , or not...
...well that depends on your application.
Volatile is (typically) used for variables that are accessed from several threads in the application, and for Special Function Register that are the connection in/out of the chip. So you must study the volatile variables that are present in this C-statement and from the usage of these volatile variables decide if you must make a change or not.

How to change
The change is to break up the C-statement, so that each new C-statement holds only one access to a volatile variable.
In this small example the variables internalChannelSelect and ADC are volatile. If so the following C-source will issue the "Warning[Pa082]".

intAnalogSample[internalChannelSelect] = ADC[internalChannelSelect] ;

Then the following change will make the C-source predictable.

i = internalChannelSelect;
k = ADC;
intAnalogSample
= k;

 

原因是一條語句中出現(xiàn)2個或2個以上的volatile變量。可以利用中間變量將其修改。也可以在,



也可

關(guān)閉窗口

相關(guān)文章