07-27-2023, 06:25 AM
Are unpacked struct in packed struct automatically packed by GCC?
In other words, do `__packed__` attribute automatically propagates to nested structures?
That is to say:
struct unpackedStruct{
int16_t field1;
int32_t field2;
// etc...
}
struct packedStruct{
int16_t field1;
struct unpackedStruct struct1; // <-- Is this struct packed?
// etc...
} __attribute__((__packed__));
In other words, do `__packed__` attribute automatically propagates to nested structures?
That is to say:
struct unpackedStruct{
int16_t field1;
int32_t field2;
// etc...
}
struct packedStruct{
int16_t field1;
struct unpackedStruct struct1; // <-- Is this struct packed?
// etc...
} __attribute__((__packed__));