Staffan Tjernstrom <stjernstrom@xxxxxxx> writes: > #define rb_parent(r) ((struct rb_node *)((r)->rb_parent_color & ~3)) > #define rb_color(r) ((r)->rb_parent_color & 1) > #define rb_is_red(r) (!rb_color(r)) > #define rb_is_black(r) rb_color(r) > #define rb_set_red(r) do { (r)->rb_parent_color &= ~1; } while (0) > #define rb_set_black(r) do { (r)->rb_parent_color |= 1; } while (0) > #define PHYSICAL_ADDR( r ) ((struct rb_node *)((size_t)(r)+(size_t)((r)?p_base:0))) > #define RELATIVE_ADDR( r ) ((struct rb_node *)((size_t)(r)-(size_t)((r)?p_base:0))) > > static void rb_insert_color(struct rb_node *p_node, struct rb_root *p_root) > { > struct rb_node *p_phys_node = PHYSICAL_ADDR(p_node); > struct rb_node *p_parent, *p_phys_parent, *p_grandparent, *p_phys_grandparent; > > while ( ( p_phys_parent = ( PHYSICAL_ADDR( p_parent = rb_parent( p_phys_node ) ) ) ) && rb_is_red( p_phys_parent ) ) > { > } The PHYSICAL_ADDR macro uses its argument twice. You are passing an assignment statement to PHYSICAL_ADDR. The effect is that you are assigning to p_parent twice in a single expression. In C/C++ assigning to the same variable more than once in a single expression is undefined behaviour. This warning is controlled by -Wsequence-point, q.v. Ian