sd-journal: variable sized array cannot be used in ObjectHeader

The struct ObjectHeader is embedded in real object structs.
Hence, the existence of the flex array in ObjectHeader violates the
requirement that flex array must be at the end of struct.
This commit is contained in:
Yu Watanabe
2025-06-04 13:13:14 +09:00
parent b525942037
commit 462d287bc9
+2 -1
View File
@@ -55,7 +55,8 @@ struct ObjectHeader {
uint8_t flags;
uint8_t reserved[6];
le64_t size;
uint8_t payload[];
uint8_t payload[0]; /* The struct is embedded in other objects, hence flex array (i.e. payload[])
* cannot be used. */
} _packed_;
#define DataObject__contents { \