The C standard (Annex C) states that there is a sequence point
After the actions associated with each formatted input/output function conversion specifier.
Given that, why am I getting an unsequenced modification and access to i
(clang) warning for the below?
int i = 0;
printf("%d, %d\n", i, ++i);
Based on the standard, there is a sequence point after the first and the second %d
. If so I should be getting a 0 1
? But then there is no ordering guarantee in the evaluation of function arguments and I could be getting 1 1
instead?
So what does the text of the standard I quoted really mean?