[comp.unix.ultrix] Use of 'volatile' on RISC ULTRIX C compiler

mcfong@mercury.sybase.com (Martin C. Fong) (10/06/90)

How does the 'volatile' keyword affect the declarations below:

	volatile int * a;
	int volatile * b;
	int * volatile c;

All three statements are legal under the RISC ULTRIX C compiler.

Most of the documentation I have (including DEC's) does not elaborate
enough (for me anyway) on how the 'volatile' declaration should be
used.


Thanks.

Martin C. Fong
Sybase Inc.
6475 Christie Ave.
Emeryville, CA  94607
(415)596-3822
sun!sybase!mcfong
mcfong@sybase.com
decwrl::"@tis.llnl.gov:mcfong@sybase.com"

evans@decvaxdec.com (Marc Evans Ultrix Q/A) (10/11/90)

In article <11190@sybase.sybase.com>, mcfong@mercury.sybase.com (Martin C. Fong) writes:
|> How does the 'volatile' keyword affect the declarations below:
|> 
|> 	volatile int * a;
|> 	int volatile * b;
|> 	int * volatile c;
|> 
|> All three statements are legal under the RISC ULTRIX C compiler.
|> 
|> Most of the documentation I have (including DEC's) does not elaborate
|> enough (for me anyway) on how the 'volatile' declaration should be
|> used.

Prior to version 2.1 of the MIPS C compiler, use of the volatile keyword will
almost always produce a bad program. You should not use it...

As far as its intended definition though, it is suppose to comply with the
ANSI definition.

- Marc
-- 
===========================================================================
Marc Evans - WB1GRH - evans@decvax.DEC.COM  | Synergytics     (603)635-8876
      Unix and X Software Contractor        | 21 Hinds Ln, Pelham, NH 03076
===========================================================================