This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Incrementing volatiles?
- To: Carlo Wood <carlo at runaway dot xs4all dot nl>
- Subject: Re: Incrementing volatiles?
- From: Andreas Schwab <schwab at issan dot informatik dot uni-dortmund dot de>
- Date: 17 Jul 1998 13:10:21 +0200
- Cc: egcs at cygnus dot com (egcs at cygnus dot com)
- References: <199807152343.BAA14489@jolan.ppro>
Carlo Wood <carlo@runaway.xs4all.nl> writes:
|> Can someone explain to me what exactly the definition
|> of 'volatile' is? :)
>From the C9x draft:
6.5.3 Type qualifiers
[#6] An object that has volatile-qualified type may be
modified in ways unknown to the implementation or have other
unknown side effects. Therefore any expression referring to
such an object shall be evaluated strictly according to the
rules of the abstract machine, as described in 5.1.2.3.
Furthermore, at every sequence point the value last stored
in the object shall agree with that prescribed by the
abstract machine, except as modified by the unknown factors
mentioned previously.99 What constitutes an access to an
object that has volatile-qualified type is implementation-
defined.
Footnote:
99. A volatile declaration may be used to describe an object
corresponding to a memory-mapped input/output port or an
object accessed by an asynchronously interrupting
function. Actions on objects so declared shall not be
``optimized out'' by an implementation or reordered
except as permitted by the rules for evaluating
expressions.
--
Andreas Schwab "And now for something
schwab@issan.informatik.uni-dortmund.de completely different"
schwab@gnu.org