How does gcc push local variables on to the stack?
问题 void f () { int a[1]; int b; int c; int d[1]; } I have found that these local variables, for this example, are not pushed on to the stack in order. b and c are pushed in the order of their declaration, but, a and d are grouped together. So the compiler is allocating arrays differently from any other built in type or object. Is this a C/C++ requirement or gcc implementation detail? 回答1: The C standard says nothing about the order in which local variables are allocated. It doesn't even use the