On Tue, Oct 15, 2002 at 08:28:02AM +1000, Herbert Xu wrote: > On Mon, Oct 14, 2002 at 06:01:24PM -0400, Daniel Jacobowitz wrote: > > > > I don't see the problem. Volatile in C doesn't provide any sort of > > barrier; you have to place one yourself if you want one. It only > > guaranatees that the two accesses to "i" will not be reordered or > > eliminated. > > My copy of C99 says: > > 5 The least requirements on a conforming implementation are: > - At sequence points, volatile objects are stable in the sense that > previou > s accesses are > complete and subsequent accesses have not yet occurred.
Only volatile objects are required to be stable. I believe that if "j" were volatile, then you'd see the behaviour you want; but I don't believe accesses to non-volatile objects have the same requirements. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer