www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/18/13:31:15

From: Brian Osman <osmanb AT rpi DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: french documentations ?
Date: Thu, 18 Sep 1997 10:24:05 -0400
Organization: Rensselaer Polytechnic Institute, Troy NY, USA
Lines: 23
Message-ID: <34213985.815BB210@rpi.edu>
References: <01bcc419$00c3f500$9b0a020a AT grumpy5 DOT univ-lr DOT fr>
Reply-To: osmanb AT acm DOT org
NNTP-Posting-Host: darkwing.stu.rpi.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I'd try responding in my barely used french, but it would make even less
sense than my english...

Anyway, I don't know about french documentation, but volatile is another
keyword that can be tagged on variables. (like const, or static...)

However, the compiler really doesn't HAVE to do anything. VOLATILE is
compiler dependent. The usual usage is to indicate that a variable is
not just memory, but something like an I/O address. This way, if you
write:

*foo = 1234;
*foo = 5678;

The compiler might normally think this was dumb, and remove the first
statement. But with foo declared volatile, it (might) not optimize this,
thinking that assigning to foo twice could have a real effect. Also, it
goes the other way. The value could change at just about any time, so
reading the variable many times shouldn't be reduced to one access. I
had this exact same question this summer, and this was the explanation I
got, so I hope it's right.

Brian

- Raw text -


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