When I compile the function below with: gcc -S teste.c
void readInput() {
int buf;
}
teste.S becomes:
readInput:
pushl %ebp
movl %esp, %ebp
subl $16, %esp
leave
ret
my doubt is: why %esp is subtracted from 16 bytes, shouldn't it be 4 bytes for an int? Does it have todo with alignment?
Similar thing happen when I compile this:
void readInput() {
char buf;
}
and the output is the same as above.