|
|
|
|
|
by cperciva
4144 days ago
|
|
The key text is in C99 §6.7.4: "An object that has volatile-qualified type...". Note that this does not say "An object accessed via a pointer to a volatile-qualified type": What matters is the type of the underlying object, i.e., how it is originally defined. |
|
That being said...
§6.5.3.1/4 The unary * operator denotes indirection. (...) the result is an lvalue designating the object.
So, I believe that there will be no difference in access to something declared as
and if the access to v will always be performed through such a cast, as ((volatile..)) will always denote the same "volatile" X object stored in v, independent of the fact that storage to the volatile X object is allocated in a "nonvolatile" X object.