data types

Tom Middleton middleto at sdsu.UUCP
Sun Feb 5 07:39:40 AEST 1989


In article <2916 at hound.UUCP> rkl1 at hound.UUCP (K.LAUX) writes:
>	Int	is the default word size on the machine,
>	Long	must be equal to or greater than the size of an Int,
>	Short	must be equal to or less than the size of an Int.

In article <> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
-Close, except there is no requirement that "int" be the "natural"
-word size, just a recommendation that it be so.  In fact some 64-bit
-C implementors have had to agonize over whether to make int 64 bits
-or 32.  (The latter to make it easier to port 4BSD VAX code that has
-that assumption, or the assumption that long is 32 bits, wired in.)

Yes, sizeof(int) on our 64-bit machine returned 4 (4*8=32) so the
compiler writers decided to stick with a 32-bit int, even tho the
word size is 64.

The general consensus is
	sizeof(short) <= sizeof(int) <= sizeof(long)
Thank you to all the people who have responded.

Now, please, I ask you in the most respectful manner, stop, no more, this
question is resolved.  Thank you.

-- 
 G O    P A D R E S !		Thomas Earl Middleton
    1989			aka Happy Bare
 N L    C H A M P S !		UUCP  ...!ucsd!sdsu!middleto
 W S    C H A M P S !		ARPA  middleto%sdsu.uucp at ucsd.edu



More information about the Comp.lang.c mailing list