www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/02/18:24:02

Date: Mon, 3 Jun 1996 08:17:37 +1000 (EST)
From: John Joseph Newbigin <079519 AT bud DOT cc DOT swin DOT edu DOT au>
To: "Christoph P. Kukulies" <kuku AT gilberto DOT physik DOT RWTH-Aachen DOT DE>
Cc: myskin%inp DOT nsk DOT SU AT psuorvm DOT cc DOT pdx DOT edu, djgpp AT delorie DOT com
Subject: Re: What is 'volatile'?
In-Reply-To: <199606011042.MAA29398@gilberto.physik.rwth-aachen.de>
Message-Id: <Pine.OSF.3.91.960603081454.20552B-100000@bud.cc.swin.edu.au>
Mime-Version: 1.0

> > Hi all!
> > Tell me please what does the keyword 'volatile' or '__volatile__'
> > mean. I can't find any info about it in FAQ or docs.
> 
> It's an extension to C (can be found in the gcc docs) and means
> that something declared 'volatile' (a function or a variable or
> another entity) should not be touched by any compiler optimization
> algorithm..
> Sure there's a bit more behind it but this is the most common
> reason to declare a piece of code 'volatile'.
> 

The reason I use volatile (I guess it must be the second most common 
reason:)is to make sure that any variable changed by an interrupt routine 
is used correctly by the rest of the program.  This is needed with and 
without optimization.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019