On Monday, 2 June 2014 at 17:27:52 UTC, Johannes Pfau wrote:
And of course without a type qualifier there can't be transitivity. The programmer always has to be careful to access struct members, array members,
and other types 'connected' via indirection with peek/poke.

I too think that a) volatile is necessary, and b) that it should apply to variables, not operations. However, I'm not convinced of transitivity. It makes sense to treat members of a volatile struct as volatile, too, but I don't see why this needs to be the case for pointers. Are there even cases of volatile pointers at all? Usually, hardware registers don't contain pointers, and when they do (DMA-like things maybe, but those typically use physical addresses, not (virtual) pointers), what they point to would probably be normal memory, wouldn't it?

Reply via email to