I know that was the point, but I thought the spec on ++ is that it occurs after the statement. I thought the spec on parens is that they are sub statement. Since there are two ++ occurring, it is odd, but I thought by spec the 12 is right.
The spec says "The value of the operand of the prefix ++ operator is incremented. The result is the new value of the operand after incrementation. The expression ++E is equivalent to (E+=1)."
I think the problem in the example from the article is that the spec doesn't say what happens to i when it appears twice in the same expression. What is the "current" value of i each increment sees?
Maybe they both see the initial value 5, and the result is (5+1) + (5+1) = 12 like you say. But compiling the example with gcc 4.6.3 gives me 14 as a result! It seems as if gcc is seeing the two updates and then replacing each occurrence of i with the final value 7 (but I'm guessing). I guess the point is that, since it isn't in the spec, each implementation of C is free to do whatever the implementors decided.