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.

Compiler/CC3200SDK: compiler/ optimisation issue - Ti5.2.8 compiler

Part Number: CC3200SDK

Tool/software: TI C/C++ Compiler

I've noticed what I think is a problem with the 5.2.8 compiler

This fragment:

current_message = (current_message++) % 4;

will reach 4 before it loops around. It's as if the ++ is being applied _after_ the % 4

If I change it to:

current_message = (current_message+1) % 4;

I get the expected behaviour - 0 , 1 , 2 , 3 , 0 etc.

optimisation is on level 4, and speed vs. size is 0 (size)

not a problem now I understand it, but definitely seems wrong.

I know 5.2.8 isn't the current compiler but a library I'm using requires it.