64 bit ints

Larry Jones scjones at sdrc.UUCP
Mon Oct 31 01:24:18 AEST 1988


In article <225800084 at uxe.cso.uiuc.edu>, mcdonald at uxe.cso.uiuc.edu writes:
< [without attribution]
< >Suppose I am designing a C compiler for a machine with 64bit
< >words. "Char" should be 8bits of course and "long int" 64 since
< >pointers will be.
< >How long should an "int" be (32 or 64)? 
< >How about a "short int" (16/32)?
< >How is this decision altered if partial word accesses 
< >are more expensive than full word accesses?
< The answer here should be very clear:
<      Make the compiler so that it can handle the general case of
<            char    8 bits
<            short int 16 bits
<            int        32 bits
<            long int    64 bits.
< 
< Then allow the user to specify, either by an "install" program,
< by command line switches, by a "config" file, or by (gasp) pragmas,
< whatever combination of shorts, ints and longs he wants, so
< long as they fit the usual rules of C.

The answer may be clear, but it's also wrong (at least by some
standards).  The draft ANSI standard requires that int
be the same size as either short or long; it may not be a third,
distinct, size of integer.

----
Larry Jones                         UUCP: uunet!sdrc!scjones
SDRC                                      scjones at sdrc.uucp
2000 Eastman Dr.                    BIX:  ltl
Milford, OH  45150                  AT&T: (513) 576-2070
"Save the Quayles" - Mark Russell



More information about the Comp.lang.c mailing list