From: Thomas S. <tho...@gm...> - 2001-09-21 13:57:37
|
Hi all I've seen some mix of int, long and size_t in the jb code which makes a lot of trouble if sizeof(int) != sizeof(long) != sizeof(size_t). So please check the code (and don't mix this in new code) for this types. I prefer this: 32bit HW 64 bit HW int signed 32 bit 32 bit long signed 32 bit 64 bit size_t unsigned 32 bit 64 bit char * 32 bit 64 bit If you need/ use long or size_t you *MUST* check the size of this type before. The configure script does some tests right now, but we should add some makros for the latter 2 ones in one header file. use this for test: -----------8<----------- #include <stdio.h> main() { printf("sizeof(char) = %d\n", sizeof(char)); printf("sizeof(short) = %d\n", sizeof(short)); printf("sizeof(int) = %d\n", sizeof(int)); printf("sizeof(size_t) = %d\n", sizeof(size_t)); printf("sizeof(long) = %d\n", sizeof(long)); printf("sizeof(long long) = %d\n", sizeof(long long)); printf("sizeof(float) = %d\n", sizeof(float)); printf("sizeof(double) = %d\n", sizeof(double)); printf("sizeof(long double) = %d\n", sizeof(long double)); printf("sizeof(char*) = %d\n", sizeof(char*)); printf("sizeof(int*) = %d\n", sizeof(int*)); printf("sizeof(long*) = %d\n", sizeof(long*)); } -----------8<----------- Some output: alpha Linux merlin 2.4.6 #8 Wed Sep 5 15:49:51 MEST 2001 alpha unknown ----- sizeof(char) = 1 sizeof(short) = 2 sizeof(int) = 4 sizeof(size_t) = 8 sizeof(long) = 8 sizeof(long long) = 8 sizeof(float) = 4 sizeof(double) = 8 sizeof(long double) = 8 sizeof(char*) = 8 sizeof(int*) = 8 sizeof(long*) = 8 intel ----- sizeof(char) = 1 sizeof(short) = 2 sizeof(int) = 4 sizeof(size_t) = 4 sizeof(long) = 4 sizeof(long long) = 8 sizeof(float) = 4 sizeof(double) = 8 sizeof(long double) = 12 sizeof(char*) = 4 sizeof(int*) = 4 sizeof(long*) = 4 sun solaris SunOS sun 5.8 Generic_108528-08 sun4u sparc SUNW,Ultra-5_10 ---------- sizeof(char) = 1 sizeof(short) = 2 sizeof(int) = 4 sizeof(size_t) = 4 sizeof(long) = 4 sizeof(long long) = 8 sizeof(float) = 4 sizeof(double) = 8 sizeof(long double) = 16 sizeof(char*) = 4 sizeof(int*) = 4 sizeof(long*) = 4 Thanks Thomas |