This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Size of C/C++ data type from GNU GCC/g++ compiled ELF 64-bit LSB executable, AMD x86-64 vs. ELF 32-bit LSB executable, Intel 80386
- From: Andrew Haley <aph-gcc at littlepinkcloud dot COM>
- To: tom peng <tompeng at microsoft dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 18 Jun 2007 22:18:33 +0100
- Subject: Re: Size of C/C++ data type from GNU GCC/g++ compiled ELF 64-bit LSB executable, AMD x86-64 vs. ELF 32-bit LSB executable, Intel 80386
- References: <11184115.post@talk.nabble.com>
tom peng writes:
>
> I posted this message on gcc/bug forum earlier. I repost the same contents
> here. I need experts to shed light on C/C++ data type size inconsistencies
> when running 64-bit and 32-bit ELF executables compiled by GNU/GCC g++/gcc
>
> Following are results of C/C++ data type size from code " cout << "data
> type" << sizeof(data type) << endl " :
>
> | 32-bit | 64-bit
> -------------------------------
> int | 4 | 4
> -------------------------------
> long int | 4 | 8
> -------------------------------
> signed long int | 4 | 4
No, that should be 4 8
> -------------------------------
> ulong | 4 | 8 (sys/types.h)
> -------------------------------
> long double | 12 | 16
Seems OK otherwise. What's your problem?
Andrew.