Difference in data alignment in struct vs parameter?
问题 Given the following code: typedef struct tagRECT { int left; int top; int right; int bottom; } RECT; extern int Func(RECT *a, int b, char *c, int d, char e, long f, int g, int h, int i, int j); int main() { } void gui() { RECT x = {4, 5, 6, 7}; Func(&x, 1, 0, 3, 4, 5, 6, 7, 8, 9); } This is the assembly generated gcc x86_64 presumably on linux (I used compiler explorer). main: mov eax, 0 ret gui: push rbp mov rbp, rsp sub rsp, 16 ; RECT x assignment mov DWORD PTR [rbp-16], 4 mov DWORD PTR