Skip to Content.
Sympa Menu

c-semantics - Re: [C-Semantics] volatiles

c-semantics AT lists.cs.illinois.edu

Subject: C Semantics in K Framework

List archive

Re: [C-Semantics] volatiles


Chronological Thread 
  • From: John Regehr <regehr AT cs.utah.edu>
  • To: c-semantics AT cs.illinois.edu
  • Subject: Re: [C-Semantics] volatiles
  • Date: Thu, 23 Jun 2011 14:31:18 -0600
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/c-semantics>
  • List-id: C Semantics in K Framework <c-semantics.cs.illinois.edu>

Sure-- I thought you might be talking about some sort of C-level problem.

In practice, it's almost certainly never a good idea to read device registers in unspecified order. Some embedded compilers warn about this. Providing robust checking for this would be a very good use of kcc.

John




On 06/23/2011 02:26 PM, Derek M Jones wrote:
John,

volatile int v1 = 0, v2 = 0;
v1 + v2;

Subtraction is more of a problem if they both map to the same input
device.

I don't see the problem with subtraction and the same input device, can
you explain?

If the successive characters on the input port that both v1 and v2
happen to map to are '1' and '2' then the result of the subtraction
will depend on which of the two operands is evaluated (ie reads from
the input port) first.





Archive powered by MHonArc 2.6.16.

Top of Page