diff options
author | Tianyu Li <tianyu.li@arm.com> | 2021-05-18 22:19:26 +0800 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2021-05-21 06:23:20 +0000 |
commit | 40c11e604ca48904d76f311ec761b5e71ff99797 (patch) | |
tree | 64fe2c955a07f31aa9877904710e0e6840dbdb93 /src | |
parent | 94c7236ec308ba52d0365aff4236425136c8cdb6 (diff) |
memif: fix gcc-10 build error on arm platform
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 <tianyu.li@arm.com>
Change-Id: I7a6ad89f95e1b5e3f9aac36546a2559dbda9bd6c
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/memif/memif.h | 2 |
1 files changed, 1 insertions, 1 deletions
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_ */ |