From: Benoît Ganne Date: Fri, 24 Apr 2020 09:48:04 +0000 (+0200) Subject: vlib: use flexible array in vlib_buffer for GCC-10 X-Git-Tag: v20.09-rc0~102 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F89%2F26689%2F2;p=vpp.git vlib: use flexible array in vlib_buffer for GCC-10 GCC-10 increase overflows-related warnings but gets confused by 0-length arrays. Use C99 flexible length array instead. Type: fix Change-Id: Ie62cfa8faaa408479a598785fd3f06ffd0233c7a Signed-off-by: Benoît Ganne --- diff --git a/src/vlib/buffer.h b/src/vlib/buffer.h index cfe7d6487b6..3144888f604 100644 --- a/src/vlib/buffer.h +++ b/src/vlib/buffer.h @@ -178,7 +178,7 @@ typedef union u8 pre_data[VLIB_BUFFER_PRE_DATA_SIZE]; /** Packet data */ - u8 data[0]; + u8 data[]; }; #ifdef CLIB_HAVE_VEC128 u8x16 as_u8x16[4];