Re: Q: void* vs. unsigned long (fwd)

Albert D. Cahalan (acahalan@cs.uml.edu)
Tue, 16 Feb 1999 21:54:28 -0500 (EST)


Francois Desarmenien writes:
> John Cochran wrote:

>> The 1st bullet indicates that rank is independant of representation
>> and if you look at the definitions within <limits.h> (5.2.4.2.1)
>> you'll see that
>> signed char is at least 8 bits long
>> short int is at least 16 bits long
>> int is at least 16 bits long
>> long is at least 32 bits long
>> long long is at least 64 bits long
>
> That's not exactly the definitions I've learnt:
>
> It should be assumed that:
>
> char *is* 8 bits
> short int *is* 16 bits
> int is the size of int nativly handled by your CPU: can be anything
> long *is* 32 bits
> long long *is* 64 bits

Arrrgh!!!! Ignoring DSPs, 1970's hardware, and other junk...

char 8
short 16
int 32 (goodbye Windows 3.1, we won't miss you)
long same as a pointer, except 32 for broken Win64
long long 64 (not 128, even on the Alpha)

Pointers are 32 bits on normal hardare and 64 bits on good hardware.
Pointers (and long) are the size of int nativly handled by your CPU.
Plain int is smaller than the native size on a 64-bit CPU.

If you have any of these:

8-bit Apple ][
16-bit 80286
18-bit PDP-7
30-bit IBM mainframe
36-bit Honeywell mainframe
60-bit Cray

Just drag-and-drop it into the nearest landfill. You might need
a backhoe and dumptruck for some of them, but just think of the
space (rent?) and electricity that you will save.

(you might want to strip them for copper, gold, and steel first)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/