From 7465c16e73f2cb9b01b9a0cd3e513dbe5f2470ef Mon Sep 17 00:00:00 2001 From: Elyes Haouas Date: Fri, 28 Jul 2023 06:10:19 +0200 Subject: lib/cbmem_console.c: 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: I3d716b29d8e28584a0c9e4056d4c93dca2873114 Signed-off-by: Elyes Haouas Reviewed-on: https://review.coreboot.org/c/coreboot/+/76780 Reviewed-by: Arthur Heymans Tested-by: build bot (Jenkins) --- src/lib/cbmem_console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/cbmem_console.c b/src/lib/cbmem_console.c index ad3b99bbba..fe33c3b6a4 100644 --- a/src/lib/cbmem_console.c +++ b/src/lib/cbmem_console.c @@ -28,7 +28,7 @@ struct cbmem_console { u32 size; u32 cursor; - u8 body[0]; + u8 body[]; } __packed; #define MAX_SIZE (1 << 28) /* can't be changed without breaking readers! */ -- cgit v1.2.3