🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c++.moderated
Article #29

Re: Meaning of the specifier volatile?

#29
From: Ari Lukumies
Date: Thu, 04 Jan 1996 11:45
31 lines
1750 bytes
X-Original-Date: Thu, 04 Jan 1996 11:47:04 +0200

Srinivas Vobilisetti (srv@cs.wayne.edu) wrote:

|> I referred to various books on C++ including The C++ 
Programming Language
|> -Bjarne Stroustrup, C++ Primer -Stanley Lipmann, etc.  
Nowhere i could find
|> exact meaning of the specifier volatile. Thanks in advance 
for your help.

As told in many replies, volatile specifies that the 
variable's contents can change between its use in the program. 
However, volatile allows you to add another level of checking, 
too. For instance, if you know that your program should never 
change the variable's contents (eg. a memory location for a 
real-time clock value), you can use const volatile. Thus, the 
compiler will check at compile time that your program will not 
modify itself the value, but will prevent optimization of 
using the value once read.

 Ari Lukumies


-- 
All my opinions are mine and mine alone.

    [ comp.lang.c++.moderated is a moderated newsgroup.  Submit articles ]
    [  to <c++-submit@netlab.cs.rpi.edu>.  The moderation policy can be  ]
    [   retrieved from <http://netlab.cs.rpi.edu/~cppmods/guide.html>.   ]
    [    Moderators can be reached at: c++-request@netlab.cs.rpi.edu.    ]
Technical Details
Message-ID: <4cgel1$if6@netlab.cs.rpi.edu>
Path: arc1-ca.pugleaf.net!eerie.acsu.buffalo.edu!newserve!rebecca!rpi!not-for-mail
References: <4c9740$27n@netlab.cs.rpi.edu> <4ce5ao$ds3@netlab.cs.rpi.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!eerie.acsu.buffalo.edu!newserve!rebecca!rpi!not-for-mail
From: Ari Lukumies <aril@cmt.lpr.mail.carel.fi>
Newsgroups: comp.lang.c++.moderated,comp.lang.c++
Subject: Re: Meaning of the specifier volatile?
Date: 4 Jan 1996 11:45:37 -0000
Organization: Carelcomp Forest
Sender: cppmods@netlab.cs.rpi.edu
Approved: kanze@gabi-soft.fr
Message-ID: <4cgel1$if6@netlab.cs.rpi.edu>
References: <4c9740$27n@netlab.cs.rpi.edu> <4ce5ao$ds3@netlab.cs.rpi.edu>
NNTP-Posting-Host: netlab.cs.rpi.edu