[ovs-dev] [PATCH] nsh: Avoid zero-length array.

Ben Pfaff blp at ovn.org
Tue Aug 8 21:56:25 UTC 2017


MSVC allows [] but not [0] for arrays in struct definitions.

Reported-by: Alin Serdean <aserdean at cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>
---
 include/openvswitch/nsh.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/openvswitch/nsh.h b/include/openvswitch/nsh.h
index d9be1e6fa3b4..95210ac04b82 100644
--- a/include/openvswitch/nsh.h
+++ b/include/openvswitch/nsh.h
@@ -68,7 +68,7 @@ struct nsh_hdr {
     ovs_16aligned_be32 path_hdr;
     union {
         struct nsh_md1_ctx md1;
-        struct nsh_md2_tlv md2[0];
+        struct nsh_md2_tlv md2[];
     };
 };
 
-- 
2.10.2



More information about the dev mailing list