No you cannot use
int foo = setjmp(buf); foo = setjmp(buf);
The reason for the later (assignment) is probably because the assignment is an expression that can have more than just an identifier on the left side. If the left side is an lvalue expression, the standard does not impose the order in which the subexpressions are evaluated. Therefore, if you have
int* f(void); *f() = setjmp(buf);
*f() and setjmp(buf) can be evaluated in any order. Since setjmp takes a snapshot of the actual state of the abstract state of the machine, the semantics of both orders will be completely different.
For the first line (initialization) this problem does not occur, I think. Therefore, I suggest that this could be added as actual use. But it will need to be thoroughly discussed if there are no border cases that still require evaluation from the left.
(Eric has already answered for the approval of the choice.)
source share