What you have is undefined behavior. The order in which function arguments are evaluated is unspecified in the standard, so how they are evaluated is compiler specific. Here is a link to Kernigan & Ritchie. See chapter 2.12, (specifically page 49) for an example similar to yours.
Comment