From 40c11e604ca48904d76f311ec761b5e71ff99797 Mon Sep 17 00:00:00 2001 From: Tianyu Li Date: Tue, 18 May 2021 22:19:26 +0800 Subject: memif: fix gcc-10 build error on arm platform MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In function ‘memcpy’, inlined from ‘memif_device_input_zc_inline’ at src/plugins/memif/node.c:850:7, string_fortified.h:34:10: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=] 34 | return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/plugins/memif/node.c: In function ‘memif_input_node_fn_neoversen1’: src/plugins/memif/memif.h:175:16: note: at offset 0 to object ‘desc’ with size 0 declared here 175 | memif_desc_t desc[0]; | ^~~~ Using C99 way empty brackets for flexible array members Type: fix Signed-off-by: Tianyu Li Change-Id: I7a6ad89f95e1b5e3f9aac36546a2559dbda9bd6c --- src/plugins/memif/memif.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/memif') diff --git a/src/plugins/memif/memif.h b/src/plugins/memif/memif.h index 8539c984732..1c92d2640e5 100644 --- a/src/plugins/memif/memif.h +++ b/src/plugins/memif/memif.h @@ -172,7 +172,7 @@ typedef struct MEMIF_CACHELINE_ALIGN_MARK (cacheline1); volatile uint16_t tail; MEMIF_CACHELINE_ALIGN_MARK (cacheline2); - memif_desc_t desc[0]; + memif_desc_t desc[]; } memif_ring_t; #endif /* _MEMIF_H_ */ -- cgit 1.2.3-korg