@
wwqgtxx You are right
// sizeof.cpp
#include <iostream>
void printSizeof() {
int sizeofValue = sizeof("a");
// std::cout<<sizeofValue<<std::endl;
}
bash - :~ # g++ -c -O0 sizeof.cpp
bash - :~ # objdump -S sizeof.o | less
...
0000000000000000 <_Z11printSizeofv>:
0: 55 push %rbp
1: 48 89 e5 mov %rsp,%rbp
4: 48 83 ec 10 sub $0x10,%rsp # 给 int a 分配储存空间,0x10 大概是为了对齐
8: c7 45 fc 02 00 00 00 movl $0x2,-0x4(%rbp) # 把值 0x2 存入变量 a 中
f: 90 nop
10: 48 83 c4 10 add $0x10,%rsp
14: 5d pop %rbp
15: c3 retq
...