Hello,
Please see code below. I am using C2000 compiler version v6.2.9.
unsigned int x = 0; int main(void) { x = (x++)%3; // x is zero after this statement. It should be 1. return 0; }
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
This is not a compiler bug, you are in undefined behavior-land: http://en.wikipedia.org/wiki/Sequence_point
Markus