3 ms·
Doesn't even need to be a struct within a struct: struct Foo { int8_t a; int8_t b; int8_t c; }; will have a size of 3 and an alignment of 1. Alignme
by compiler-guy 1y ago
Doesn't even need to be a struct within a struct:
struct Foo {
int8_t a;
int8_t b;
int8_t c;
};
will have a size of 3 and an alignment of 1. Alignment is always power of 2, and size modulus alignment will always be zero. But alignment can be less than size, and size need not be a power of two, just have one power-of-two factor.