|
楼主 |
发表于 2016-11-24 10:07:32
|
显示全部楼层
系统环境为:
- Linux zwfedora23 4.4.9-300.fc23.x86_64+debug #1 SMP Wed May 4 23:44:03 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
复制代码
gcc版本为:
- Using built-in specs.
- COLLECT_GCC=gcc
- COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/lto-wrapper
- Target: x86_64-redhat-linux
- Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --disable-libgcj --with-isl --enable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
- Thread model: posix
- gcc version 5.3.1 20160406 (Red Hat 5.3.1-6) (GCC)
复制代码
简单测试代码:
- 1 #include<stdio.h>
- 2 #include<string.h>
- 3 #include<stdlib.h>
- 4 //#include<stdint.h>
- 5
- 6
- 7 int main(void)
- 8 {
- 9 printf("sizeof(long long)=%d\n",sizeof(long long));
- 10 printf("sizeof(signed long)=%d\n",sizeof(signed long));
- 11 printf("sizeof(unsigned long)=%d\n",sizeof(unsigned long));
- 12 printf("sizeof(int)=%d\n",sizeof(int));
- 13 printf("sizeof(short int)=%d\n",sizeof(short int));
- 14 printf("sizeof(int64_t)=%d\n",sizeof(int64_t));
- 15 printf("sizeof(__int128)=%d\n",sizeof(__int128));
- 16 //printf("sizeof(__int256)=%d\n",sizeof(__int256));
- 17
- 18 return 0;
- 19 }
复制代码
运行结果:
- sizeof(long long)=8
- sizeof(signed long)=8
- sizeof(unsigned long)=8
- sizeof(int)=4
- sizeof(short int)=2
- sizeof(int64_t)=8
- sizeof(__int128)=16
复制代码
|
|