J"org wrote:

"As the code works as is (with the warning), I bet the volatile
qualification wasn't needed at all in the first place, and could as
well be omitted."

Glurgh ... (more strangling sounds) ... that's not my understanding of how things should be done. If a variable requires volatile treatment, just because it works today without it does not mean you can leave it out. If you change the compiler, or just rearrange a bit of code, then the forbidden optimizations could appear and break it. Correct me if I'm wrong, but my impression is that the programmer must identify all variables that should be qualified volatile by thinking about the program logic and that the purpose of the warning we're discussing is precisely to tell him that volatile treatment is not guaranteed and he should think about it some more.

Graham.




_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to