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 <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76780
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Elyes Haouas
2023-07-28 06:10:19 +02:00
parent a8a0d394dd
commit 7465c16e73

View File

@ -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! */