volatile required?

Claus Tondering ct at dde.dk
Wed Sep 27 21:39:37 AEST 1989


Consider the following program:

	main()
	{
	  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.
-- 
Claus Tondering
Dansk Data Elektronik A/S, Herlev, Denmark
E-mail: ct at dde.dk    or    ...!uunet!mcvax!dkuug!dde!ct



More information about the Comp.std.c mailing list