This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: int64_t == long long
- From: Yang Zhang <yanghatespam at gmail dot com>
- To: John Love-Jensen <eljay at adobe dot com>
- Cc: GCC-help <gcc-help at gcc dot gnu dot org>
- Date: Tue, 01 Jul 2008 16:01:38 -0400
- Subject: Re: int64_t == long long
- References: <C48FF080.31D17%eljay@adobe.com>
John Love-Jensen wrote:
On 7/1/08 2:17 PM, "Yang Zhang" <yanghatespam@gmail.com> wrote:
Hi, why isn't int64_t == long long at least on 64-bit x86 Linux?
Because int64_t should be 64-bit, but long long could be 64-bit or larger.
#include <stdint.h> // from C99
#include <climits>
cout << (sizeof(int64_t) * CHAR_BIT) << endl;
cout << (sizeof(long long) * CHAR_BIT) << endl;
cout << sizeof(int64_t) << endl;
cout << sizeof(long long) << endl;
print:
8
8
You can also do this:
#include <stdint.h> // from C99
#include <typeinfo>
cout << typeid(int64_t).name() << endl;
cout << typeid(long long).name() << endl;
This prints:
l
x
What does this mean? (typeid(string).name() prints "Ss")
--
Yang Zhang
http://www.mit.edu/~y_z/