Larry Smith wrote: > // hmmm, pointers on 64 bit hdw are 'long', > // not 'long long'. > // int is 32 bits, long is 64 bits, ptr is > // 64 bits.
Sorry, but that is not universally true. You can be reasonably sure that a pointer has the same size as a size_t or a ptrdiff_t, but other than that all bets are off. Now, the LLP64 model makes the long long and pointers 64 bits, while long stays 32 bits. The LP64 model uses 64 bit long and pointers, which is what Linux uses on 64 bit hardware. > printf("%u = sizeof int\n", sizeof(int) ); > printf("%u = sizeof long\n", sizeof(long) ); > printf("%u = sizeof ptr\n", sizeof(void *) ); > printf("%u = sizeof long long\n", sizeof(long long) ); FYI: with 64 bit size_t and 32 bit unsigned, you have a mismatch between the printf arguments and its format string. Did you compile with any warnings? Uli -- http://gcc.gnu.org/faq.html http://parashift.com/c++-faq-lite/ _______________________________________________ help-gplusplus mailing list help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus