Mail Archives: djgpp/1997/08/06/12:20:29
> I know it sounds crazy, but what does the 'voltaile' with a
> variable/function ?
>
For a variable, basically it means that it should exist in memory, and
never be cached in a register. It has two primary uses. The first is
to allow things like binary semaphores and mutex semaphores to work
between processes and/or interrupt handlers. The second is to allow
memory-mapped i/o to work.
For a function, I believe in old versions of gcc (probably pre-2.6),that
volatile was equivalent to attribute((noreturn)).
Andrew
- Raw text -