From ae51ee8c950116f43a8213bb8d611ddfff3f4883 Mon Sep 17 00:00:00 2001 From: Elyes Haouas Date: Sun, 30 Jul 2023 17:28:49 +0200 Subject: commonlib/timestamp_serialized.h: 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: Ibd1e4bc96a2f5eea746328a09d123629c20b272c Signed-off-by: Elyes Haouas Reviewed-on: https://review.coreboot.org/c/coreboot/+/76847 Tested-by: build bot (Jenkins) Reviewed-by: Felix Singer --- src/commonlib/include/commonlib/timestamp_serialized.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/commonlib/include') diff --git a/src/commonlib/include/commonlib/timestamp_serialized.h b/src/commonlib/include/commonlib/timestamp_serialized.h index d7575e78d9..61e1565d64 100644 --- a/src/commonlib/include/commonlib/timestamp_serialized.h +++ b/src/commonlib/include/commonlib/timestamp_serialized.h @@ -16,7 +16,7 @@ struct timestamp_table { uint16_t max_entries; uint16_t tick_freq_mhz; uint32_t num_entries; - struct timestamp_entry entries[0]; /* Variable number of entries */ + struct timestamp_entry entries[]; /* Variable number of entries */ } __packed; enum timestamp_id { -- cgit v1.2.3