1 and 2 are perfectly correct. In the case of order of evaluation of operands, it is unspecified for most operators in C. Meaning that either (b=a+2)
or (a=1)
can get evaluated first, and you cannot know which order that applies for any given case.
In addition, if a variable is modified between two sequence points, any other access to that variable is not allowed, save for calculating what value to store in it.
C99 states this in 6.5 (emphasis mine):
Between the previous and next sequence point an object shall have its
stored value modified at most once by the evaluation of an expression.
Furthermore, the prior value shall be read only to determine the value to be stored.
So code like a = a+1
is perfectly well-defined, while code like a = a++
leads to undefined behavior.
It all boils down to the "abstract machine" which is the rules determining the execution order of your program. Writing a value to a variable is a side effect and the C standard states that all side effects must have occurred before the next sequence point. Now if you have several side effects related to the same variable, there are no guarantees in which order they will be sequenced in relation to each other, until the next sequence point is reached.
The practical advise to avoid bugs caused by sequencing and order of evaluation, is to keep expressions simple, with as few operators and as few side effects on each line as possible. In the case of your original example, a better way to write the code would be:
b = a + 2;
a = 1;
c = b - a;
The above code cannot be misinterpreted neither by the compiler nor by the human reader.
Just for the record, C11 has different text, but the very same meaning:
If a side effect on a scalar object is unsequenced relative to either
a different side effect on the same scalar object or a value
computation using the value of the same scalar object, the behavior is
undefined. If there are multiple allowable orderings of the
subexpressions of an expression, the behavior is undefined if such an
unsequenced side effect occurs in any of the orderings.