lkml.org 
[lkml]   [1999]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: set_current_state
From
Date
Jamie Lokier <lkd@tantalophile.demon.co.uk> writes:

Andrea Arcangeli wrote:
> >AFAIK the ordering of volatile operations is only defined with respect
> >to each other.
>
> I thought the rule was different.
I'm not absolutely sure. I read once that `volatile' accesses and I/O
function calls are the visible side-effects of a C program, which must
be preserved, and the compiler is free to optimise the rest as it
likes. I think it's a C standard issue.

Yes, it is. From 6.5.3 in the C standard:

...any expression referring to [an object that has volatile-qualified
type] shall be evaluated stricltly according to the rules of the
abstract machine... Furthermore, at every sequence point the value
last stored in the object shall agree with that prescribed by the
abstract machine... What constitutes an access to an object that has
volatile-qualified type is implementation-defined.

That's about all the C standard says about volatile accesses,
actually.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:53    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site