I am using ARM (32-bit). Assume the following function uses a stack frame to store the variables locally.
void func() {
char ch; //0x8? Shouldn't this be 0x4 with padding?
int a, b, c; //each are 0x4
double m, n; //each are 0x8
}
The size of all of these local variables is 0x24. When I subtract the three int
s (0xC) and the two double
s (0x10), I am left with 0x8, meaning that the char is taking up 8 bytes. I understand that padding helps with alignment, but if char is of size 1 and it was supposed to align, wouldn't it pad to 0x4?