This question already has an answer here:Came across this interesting question. I am aware of post increment and pre-increment.
Recently, I upgraded my project from gcc 4.3 to gcc 5.5. After that, I see a change of behaviour in the post-increment operator which is causing issues in my project. I am using a global variable as a control variable. For example, consider this sample program: