Integer sizes; storage classes.

Henry Spencer henry at utzoo.UUCP
Wed Jun 20 08:55:38 AEST 1984


Richard O'Keefe observes that at least one 6809 compiler makes int
only 8 bits.  Clearly there's a compromise here:  the 6809 is not
a great 16-bit machine, and it does much better if things are 8 bits
whenever possible.  C, alas, basically requires everything to turn
into ints whenever you do anything.  I fear that this tradeoff will
exist for almost any 8-bit machine:  do you want fast code, or portable
code?  Clearly we're not going to get a consensus of all customers on
this, because needs differ.

The question of whether C int's are required to be big enough to hold
the difference between pointers to the two ends of an array is, uh,
unresolved.  68000 C compilers with 16-bit int and 32-bit addresses
have the same problem.

As far as the "readonly" storage class, the draft ANSI C standard does
have a construct along these lines, although it's not quite the same.
They haven't done it as a storage class, so you can make such things
static without any problems.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.lang.c mailing list