I think you're imagining that the operations occur in an unspecified order, as would be the case for
foo(a(), b());
There is a sequence point when a call is executed, so a(), and b() occur in some distinct, if unspecified, order.
The program will not have undefined behavior, but may have unspecified behavior (if it depends on the order of those calls), but we can continue to reason about the C Abstract Machine for both cases.
foo(i, i++);
There is no sequence point between i and i++, so they occur at the same time, leading to a violation of the C Abstract Machine, producing undefined behavior.
We cannot reason about the program from this point onward.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think you're imagining that the operations occur in an unspecified order, as would be the case for
There is a sequence point when a call is executed, so a(), and b() occur in some distinct, if unspecified, order.
The program will not have undefined behavior, but may have unspecified behavior (if it depends on the order of those calls), but we can continue to reason about the C Abstract Machine for both cases.
There is no sequence point between i and i++, so they occur at the same time, leading to a violation of the C Abstract Machine, producing undefined behavior.
We cannot reason about the program from this point onward.