And, yet, people still try to use it for that. So it's worth pointing out that it doesn't work.
I think volatile in general is pretty useless, and it'd be better to replace it with atomic style functions:
x = volatile_read(&v);
y = use(x);
volatile_write(&y);
Which is both clearer about what's going on, and doesn't cause optimization barriers to happen everywhere, just around the specific loads and stores you care about.
Thank you for repeating me again. Though it's not even what I want then. I think the only time I've wanted volatile as is currently specified was around setjmp/longjmp -- and I think I'd prefer that setjmp/longjmp were specified in a less error prone way.
I think volatile in general is pretty useless, and it'd be better to replace it with atomic style functions:
Which is both clearer about what's going on, and doesn't cause optimization barriers to happen everywhere, just around the specific loads and stores you care about.