summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2023-01-27 16:20:50 -0800
committerDavid Gibson <david@gibson.dropbear.id.au>2023-01-29 14:42:57 +1100
commita41509bea3e73b8dc63bf666a82275bc7d040266 (patch)
tree3f9f3ba6008ef148350ece0bbe0fa24bef9b3fd3
parent2cd89f862cdb04d91c5d59c5b39647f7d5d5b3b8 (diff)
downloaddevice-tree-compiler-a41509bea3e73b8dc63bf666a82275bc7d040266.tar.gz
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 <keescook@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--libfdt/fdt.h4
1 files changed, 2 insertions, 2 deletions
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 */