[En-Nut-Discussion] Hardware Register Access Using Volatile Pointer
harald.kipp at egnite.de
Tue Apr 26 17:51:24 CEST 2011
On 4/26/2011 5:04 PM, Bernard Fouché wrote:
> Le 26/04/2011 14:55, Harald Kipp a écrit :
>> What I understood is, that volatile means for reading, that the compiler
>> must reload the value each time before using it. I can't find any
>> document that states, that the read is done in any case, even if the
>> result is not needed.
> GCC documentation (http://gcc.gnu.org/onlinedocs/gcc/Volatiles.html) says:
> A scalar volatile object is read when it is accessed in a void context:
> volatile int *src =somevalue;
Gosh! I read this document more than once, but for some reason I had
been unable to understand, that it contains the exact answer to my question.
More information about the En-Nut-Discussion