|
|
|
|
|
by cperciva
4145 days ago
|
|
The silly thing here is that this macro is not guaranteed to accomplish anything. The C standard limits how compilers can optimize accesses to volatile objects, but says nothing about accesses to non-volatile objects which are accessed via volatile-qualified pointers. |
|
But if you always access a certain object through casts to ((volatile )&x), I don't see how this should be different than accesses to a globally declared "volatile x" variable, as pointers are guaranteed to not change if casted hence-and-forth (§6.3.2.3/7).