Could anybody help me to understand what a volatile short variable should be used for? Whats the difference with short?
volatile short
Collapse
X
-
Originally posted by maxlandozCould anybody help me to understand what a volatile short variable should be used for? Whats the difference with short?
Regards -
Another way of saying this is that since the value of the variable may change ouside the control of the compiler, the compiler should make no assumptions about it. Like, put it in a register instead of making it a variable. volatile tells the compiler be dang sure you create a variable.Comment
-
Originally posted by weaknessforcatsAnother way of saying this is that since the value of the variable may change ouside the control of the compiler, the compiler should make no assumptions about it. Like, put it in a register instead of making it a variable. volatile tells the compiler be dang sure you create a variable.
a scenario where a variable is declared and not explicitly used, will be removed by the compiler. But when "volatile" keyword is used its not the caseComment
Comment