From: Xiaoyu Min Date: Mon, 15 Oct 2018 01:45:23 +0000 (+0000) Subject: net/mlx5: fix build with zero-size array X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0eef26d073ea65d966cd512303c30ea7ca924e1d;p=dpdk.git net/mlx5: fix build with zero-size array If the build environment doesn't have 'linux/tc_act/tc_pedit.h' header, compiler will use needed structs defined in mlx5_flow_tcf.c. However, there is a zero-size array defined in one struct and ISO C forbids this when -Wpedantic is set by debug mode. Simply put __extension__ keyword before the struct in question. Fixes: 2ed2fe5f0a9c ("net/mlx5: rewrite IP address UDP/TCP port by E-Switch") Signed-off-by: Xiaoyu Min --- diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_tcf.c index 1e1102e079..4b51a854e8 100644 --- a/drivers/net/mlx5/mlx5_flow_tcf.c +++ b/drivers/net/mlx5/mlx5_flow_tcf.c @@ -93,19 +93,20 @@ enum pedit_cmd { }; struct tc_pedit_key { - __u32 mask; /* AND */ - __u32 val; /*XOR */ - __u32 off; /*offset */ - __u32 at; - __u32 offmask; - __u32 shift; + __u32 mask; /* AND */ + __u32 val; /*XOR */ + __u32 off; /*offset */ + __u32 at; + __u32 offmask; + __u32 shift; }; +__extension__ struct tc_pedit_sel { tc_gen; - unsigned char nkeys; - unsigned char flags; - struct tc_pedit_key keys[0]; + unsigned char nkeys; + unsigned char flags; + struct tc_pedit_key keys[0]; }; #endif /* HAVE_TC_ACT_VLAN */