[ovs-dev] [PATCH] openvswitch/types.h: Drop the member name in initializer macro
Ben Pfaff
blp at ovn.org
Thu Jan 25 18:37:26 UTC 2018
On Thu, Jan 25, 2018 at 10:12:08AM -0800, Shashank Ram wrote:
> MSVC++ compiler does not allow initializing a struct while
> explicitly initializing a member in the struct.
>
> Not allowed:
> static const struct eth_addr a = {{ .ea= { 0xff, 0xff, 0xff, 0xff,
> 0xff, 0xff }}};
>
> Alowed:
> static const struct eth_addr b = {{{ 0xff, 0xff, 0xff, 0xff, 0xff,
> 0xff }}};
> *An extra curly brace is required for GCC in case the struct contains
> a union.
>
> Signed-off-by: Shashank Ram <rams at vmware.com>
> Tested-by: Yi-Hung Wei <yihung.wei at gmail.com>
Applied to master and branch-2.9, thanks!
More information about the dev
mailing list