jacob navia said:
I repeat:
There is NO C compiler that allows you to change the sizes of the
basic types. Period.
Please show me one C compiler that does that.
You really should stop and think for a moment before making sweeping
statements like that.
Here's the source file "c.c" that I use for all three tests:
#include <stdio.h>
int main(void)
{
printf("sizeof(long) = %d\n", (int)sizeof(long));
return 0;
}
On SPARC Solaris 9:
================================
% cc -V
cc: Sun C 5.5 Patch 112760-18 2005/06/14
usage: cc [ options] files. Use 'cc -flags' for details
% cc c.c -o c && ./c
sizeof(long) = 4
% cc -xtarget=ultra -xarch=v9 c.c -o c && ./c
sizeof(long) = 8
================================
On Fedora x86-64:
================================
% gcc --version | head -1
gcc (GCC) 4.1.2 20070626 (Red Hat 4.1.2-13)
% gcc -m32 c.c -o c && ./c
sizeof(long) = 4
% gcc -m64 c.c -o c && ./c
sizeof(long) = 8
================================
On AIX PowerPC:
================================
% xlc -qversion
IBM XL C/C++ Enterprise Edition V8.0 for AIX
Version: 08.00.0000.0011
% xlc -q32 c.c -o c && ./c
sizeof(long) = 4
% xlc -q64 c.c -o c && ./c
sizeof(long) = 8
================================
I don't know of any compilers that allow you to specify the sizes of
*all* the predefined integer types.