On 3/23/22 12:56, Adrian Moreno wrote:
> Multi-variable loop iterators avoid potential undefined behavior by
> using an internal iterator variable to perform the iteration and only
> referencing the containing object (via OBJECT_CONTAINING) if the
> iterator has been validated via the second expression of the for
> statement.
> 
> That way, the user can easily implement a loop that never tries to
> obtain the object containing NULL or stack-allocated non-contained
> nodes.
> 
> When the loop ends normally (not via "break;") the user-provided
> variable is set to NULL.
> 
> Signed-off-by: Adrian Moreno <amore...@redhat.com>
> Acked-by: Eelco Chaudron <echau...@redhat.com>
> ---

Acked-by: Dumitru Ceara <dce...@redhat.com>

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to