From a41509bea3e73b8dc63bf666a82275bc7d040266 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Fri, 27 Jan 2023 16:20:50 -0800 Subject: libfdt: Replace deprecated 0-length arrays with proper flexible arrays Replace the 0-length arrays in structures with proper flexible arrays. This will avoid warnings when building under GCC 13 with -fstrict-flex-arrays, which the Linux kernel will be doing soon: In file included from ../lib/fdt_ro.c:2: ../lib/../scripts/dtc/libfdt/fdt_ro.c: In function 'fdt_get_name': ../lib/../scripts/dtc/libfdt/fdt_ro.c:319:24: warning: 'strrchr' reading 1 or more bytes from a region of size 0 [-Wstringop-overread] 319 | leaf = strrchr(nameptr, '/'); | ^~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Kees Cook Signed-off-by: David Gibson --- libfdt/fdt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libfdt') diff --git a/libfdt/fdt.h b/libfdt/fdt.h index f2e6880..0c91aa7 100644 --- a/libfdt/fdt.h +++ b/libfdt/fdt.h @@ -35,14 +35,14 @@ struct fdt_reserve_entry { struct fdt_node_header { fdt32_t tag; - char name[0]; + char name[]; }; struct fdt_property { fdt32_t tag; fdt32_t len; fdt32_t nameoff; - char data[0]; + char data[]; }; #endif /* !__ASSEMBLY */ -- cgit v1.1