The comma operator is no different from simply two statements separated by ; in this respect
The language specifies the semantics of the operator, but the compiler/CPU can choose how they want to implement it. If they can do things out-of-order they are free to, as long as they can prove that the result will be the same as in-order. And they do, often.
If you want guarantees about the actual order for some reason, then you'll have to check your compiler and CPU documentation for how to enforce it. That might mean turning off optimizations, using extra keywords like volatile
, use memory fences, etc. However, unless you absolutely positively need in-order, let the compiler and CPU do their thing and give you extra performance at no extra cost to you.