delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/16/04:19:27

Date: Sun, 16 Apr 2000 10:39:34 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: "Alexei A. Frounze" <alex DOT fru AT mtu-net DOT ru>
cc: djgpp AT delorie DOT com
Subject: Re: THE -O2 PROBLEM - PART II
In-Reply-To: <38F8BB6D.22C2064@mtu-net.ru>
Message-ID: <Pine.SUN.3.91.1000416103916.2482f-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sat, 15 Apr 2000, Alexei A. Frounze wrote:

> the only solution I see is something like this:
> 
> ----------8<----------
> int keymap (int key) {
>   return KeyMap[key];
> }
> 
> int main() {
>   do_something();
>   if (keymap(sTab)) {
>     do_something();
>     while (keymap(sTab)) {};
>   }
>   do_something();
> }
> ----------8<----------

Nate suggested to declare KeyMap[] volatile.  That's the Right Way of
solving these problems: variables that change their values behind
compiler's back should be declared as such, and then the compiler will
do what you want.

Did you try to use `volatile'?  Did it work?  If not, why not?

- Raw text -


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