The return
statement causes its operand to be evaluated. Evaluation of an expression includes both computation of its value and of its side effects.
The C standard specifies the behavior of postfix ++
in 6.5.2.4 2:
The result of the postfix ++ operator is the value of the operand. As a side effect, the value of the operand object is incremented (that is, the value 1 of the appropriate type is added to it)…
Similarly, if we wrote a = b++;
, the assignment would not just assign the value and be done. The side effect occurs too.
The side effects are part of what an expression does, per 6.5 1:
An expression is a sequence of operators and operands that specifies computation of a value, or that designates an object or a function, or that generates side effects, or that performs a combination thereof…