summaryrefslogtreecommitdiff
path: root/util/cbfstool/ifwitool.c
diff options
context:
space:
mode:
authorElyes Haouas <ehaouas@noos.fr>2023-07-30 13:06:10 +0200
committerJakub Czapiga <jacz@semihalf.com>2023-08-01 12:51:25 +0000
commitfc2f304f062bc51cf51ad999caf13a6acc64a1b3 (patch)
tree4b4da22e0b78bdff9221b3814bc300b3f0fead40 /util/cbfstool/ifwitool.c
parentdc15867e3b938b6349fed3e809931657bdd24da6 (diff)
util: Use C99 flexible arrays
Use C99 flexible arrays instead of older style of one-element or zero-length arrays. It allows the compiler to generate errors when the flexible array does not occur at the end in the structure. Change-Id: I6b87680ec9f501945ae266ae4e4927efd2399d56 Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/76815 Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/cbfstool/ifwitool.c')
-rw-r--r--util/cbfstool/ifwitool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/cbfstool/ifwitool.c b/util/cbfstool/ifwitool.c
index efcb594360..453d85c44b 100644
--- a/util/cbfstool/ifwitool.c
+++ b/util/cbfstool/ifwitool.c
@@ -70,7 +70,7 @@ struct bpdt_entry {
struct bpdt {
struct bpdt_header h;
/* In practice, this could be an array of 0 to n entries. */
- struct bpdt_entry e[0];
+ struct bpdt_entry e[];
} __packed;
static inline size_t get_bpdt_size(struct bpdt_header *h)
@@ -124,7 +124,7 @@ struct subpart_dir_entry {
struct subpart_dir {
struct subpart_dir_header h;
/* In practice, this could be an array of 0 to n entries. */
- struct subpart_dir_entry e[0];
+ struct subpart_dir_entry e[];
} __packed;
static inline size_t subpart_dir_size(struct subpart_dir_header *h)