[ovs-dev] [PATCH] Embrace anonymous unions.

Justin Pettit jpettit at ovn.org
Thu May 24 23:44:23 UTC 2018


> On May 24, 2018, at 10:32 AM, Ben Pfaff <blp at ovn.org> wrote:
> 
> Several OVS structs contain embedded named unions, like this:
> 
> struct {
>    ...
>    union {
>        ...
>    } u;
> };
> 
> C11 standardized a feature that many compilers already implemented
> anyway, where an embedded union may be unnamed, like this:
> 
> struct {
>    ...
>    union {
>        ...
>    };
> };
> 
> This is more convenient because it allows the programmer to omit "u."
> in many places.  OVS already used this feature in several places.  This
> commit embraces it in several others.
> 
> Signed-off-by: Ben Pfaff <blp at ovn.org>

I didn't read through it carefully, but I support the change, and it's the sort of thing that normally breaks in obvious ways.

Acked-by: Justin Pettit <jpettit at ovn.org>

--Justin




More information about the dev mailing list