Mail Archives: djgpp/1996/06/15/22:04:56
Lennart Steinke wrote:
> I wrote a ISR which hook into the timer interrupt and updates
> a global variable.
...
> ist there a possibilty to tell gcc not to touch the code
> (similar to the __volatile__ keyword)?
Yes. It's called the volatile keyword. :-)
Declare the global variable as being `volatile'. Then the compiler won't
optimize the comparison away.
The `volatile' keyword is ANSI C, so you don't have to worry about it being
nonportable.
--
Erik Max Francis &tSftDotIotE && http://www.alcyone.com/max && max AT alcyone DOT com
San Jose, California, U.S.A. && 37 20 07 N 121 53 38 W && the 4th R is respect
H.3`S,3,P,3$S,#$Q,C`Q,3,P,3$S,#$Q,3`Q,3,P,C$Q,#(Q.#`-"C`- && 1love && folasade
Omnia quia sunt, lumina sunt. && Dominion, GIGO, GOOGOL, Omega, Psi, Strategem
"Out from his breast/his soul went to seek/the doom of the just." -- _Beowulf_
- Raw text -