Xref: news2.mv.net comp.os.msdos.djgpp:5008 Newsgroups: comp.os.msdos.djgpp From: aml AT world DOT std DOT com (Andrew M. Langmead) Subject: Re: How to tell djgpp NOT to optimate a line of code Message-ID: Organization: The World @ Software Tool & Die References: Date: Fri, 14 Jun 1996 12:04:09 GMT Lines: 22 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Lennart Steinke writes: >I wrote a ISR which hook into the timer interrupt and updates >a global variable. >say this var is ... my code looks something like >int b; >b=g; >while (b==g); >this loop is always optimazed to >while(1); >ist there a possibilty to tell gcc not to touch the code >(similar to the __volatile__ keyword)? Why don't you declare the variable g as a volatile int? -- Andrew Langmead