This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Does the keyword volatile work?


Fergus Henderson wrote:

On 12-May-2003, Stephen P. Smith <ischis2@cox.net> wrote:


Firstly, I would suggest using `*(volatile DWORD *)&p1'
rather than `(volatile DWORD)p1'.


Why would this be better syntax?

Secondly, if you want to be sure that the value will be assigned to
the target variable immediately, you need to declare the target
variable as volatile.

Why is that the case? I thought that the cast would be sufficient.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]