Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn
From: gwyn@smoke.BRL.MIL (Doug Gwyn)
Newsgroups: comp.std.c
Subject: Re: volatile required?
Message-ID: <11175@smoke.BRL.MIL>
Date: 28 Sep 89 14:48:37 GMT
References: <712@Aragorn.dde.dk>
Reply-To: gwyn@brl.arpa (Doug Gwyn)
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 11

In article <712@Aragorn.dde.dk> ct@dde.dk (Claus Tondering) writes:
-	  int p=3, *q=&p;
-	  *q=4;
-	  printf("%d\n",p);
-Is it acceptable that this program prints 3 instead of 4? The variable
-p is not declared volatile, and therefore the fact that *q=4 assigns
-4 to p may be considered a side effect.

No, a correct implementation must print "4" (and a new-line).
You're confusing "volatile" with "noalias" (which is no longer
in the proposed standard).  C supports aliasing via pointers.