This is an expression of expression. This is a gcc extension and according to the documentation 6.1. Expressions and declarations in expressions
The last in the compound expression must be an expression followed by a semicolon; the meaning of this subexpression serves as the meaning of the whole construct.
What is the case for the code:
({ n = pos->member.next; 1; })
the value will be 1 . According to the documentation:
This function is especially useful when creating macro definitions "safely" (so that they evaluate each operand exactly once).
He gives this example without using operator expressions:
in comparison with this safe version, with the caveat that you know the type of operands:
This is one of many gcc extensions used in the Linux kernel .
source share