*devaddr = 0 and volatile

Ken Raeburn raeburn at athena.mit.edu
Sat Dec 17 16:49:20 AEST 1988


>I don't understand what the problem is.

My problem was with the idea being discussed that references to a
volatile variable translate to exactly one memory reference.  On a
machine that may require more than one memory access to retrieve or
store one of the C data types (especially if you deal with entire
structures at a time) this wouldn't work.

Being more awake this time, I would point out that any piece of
machine-independent, portable code could have "volatile" declarations
added without ill effect (except perhaps some loss of optimization);
my references to setjmp/longjmp were just reaching for some case
outside of device drivers and the like where use of "volatile" would
be useful, but that's beside my point.  Since any type could have the
"volatile" qualifier, the one-access stuff is out the window.

I was basically trying to find out something that somebody posted a
short while later, which I hadn't noticed before in the draft
standard: "What constitutes an access to an object that has
volatile-qualified type is implementation-defined."



More information about the Comp.lang.c mailing list