环境
q@T:~$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
gdb打印数据类型大小
q@T:~$ gdb -q -x q.c
sizeof(char)=1
sizeof(short)=2
sizeof(int)=4
sizeof(long)=4
sizeof(long long)=8
sizeof(float)=4
sizeof(double)=8
sizeof(long double)=12
sizeof(int *)=4
little bit order
(gdb)
q.c的内容
q@T:~$ cat -n q.c
1 printf "sizeof(char)=%d\n",sizeof(char)
2 printf "sizeof(short)=%d\n",sizeof(short)
3 printf "sizeof(int)=%d\n",sizeof(int)
4 printf "sizeof(long)=%d\n",sizeof(long)
5 printf "sizeof(long long)=%d\n",sizeof(long long)
6 printf "sizeof(float)=%d\n",sizeof(float)
7 printf "sizeof(double)=%d\n",sizeof(double)
8 printf "sizeof(long double)=%d\n",sizeof(long double)
9 printf "sizeof(int *)=%d\n",sizeof(int *)
10
11 if((char)(((int)1) & 0xff))
12 printf "little bit order\n"
13 else
14 printf "big bit order\n"
15 end
16
17
q@T:~$