Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
Using the mbed online compiler (for various boards), the following program produces "bad" code (result is not what is reported on linux C and on teensy)
I got it to work by adding volatile to the declaration of c. (Seems like I have seen this before, but i couldn't find a post). Compiling with #pragma O2 works without volatile (as does O0 O1, but not O3)