From fc2f304f062bc51cf51ad999caf13a6acc64a1b3 Mon Sep 17 00:00:00 2001 From: Elyes Haouas Date: Sun, 30 Jul 2023 13:06:10 +0200 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/76815 Reviewed-by: Felix Singer Tested-by: build bot (Jenkins) --- util/nvramtool/coreboot_tables.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'util/nvramtool') diff --git a/util/nvramtool/coreboot_tables.h b/util/nvramtool/coreboot_tables.h index aafeab4964..d4db00c862 100644 --- a/util/nvramtool/coreboot_tables.h +++ b/util/nvramtool/coreboot_tables.h @@ -90,7 +90,7 @@ struct lb_memory_range { struct lb_memory { uint32_t tag; uint32_t size; - struct lb_memory_range map[0]; + struct lb_memory_range map[]; }; #define LB_TAG_HWRPB 0x0002 @@ -106,7 +106,7 @@ struct lb_mainboard { uint32_t size; uint8_t vendor_idx; uint8_t part_number_idx; - uint8_t strings[0]; + uint8_t strings[]; }; #define LB_TAG_VERSION 0x0004 @@ -122,7 +122,7 @@ struct lb_mainboard { struct lb_string { uint32_t tag; uint32_t size; - uint8_t string[0]; + uint8_t string[]; }; #define LB_TAG_SERIAL 0x000f #define LB_TAG_CONSOLE 0x0010 -- cgit v1.2.3