On 2/6/07, Ankit Jain <[EMAIL PROTECTED]> wrote:
Hi ppl
Can any body here make this "volatile" more clear in
terms of C language with some practical example i.e
why we need it? or for what it can be used for ?
Volatile provides a hint to the compiler not to act oversmart by
performing optimizations on the variable ;-). This is because the the
value of the variable may be modified from elsewhere (for e.g.
interrupts etc) which the compiler is not aware of. Hence it should
not cache it anywhere, and should always generate load instructions to
read the "fresh" copy.
Regards,
Rajat
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs