Whose code should we break? ( was Re: 64 bit C )

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Thu Feb 21 07:29:00 AEST 1991


In article <1991Feb20.050525.6515 at kithrup.COM> sef at kithrup.COM (Sean Eric Fagan) writes:
  [ criticizing the statement that a size_t can hold a pointer safely ]
> size_t is an integral type *big enough to hold the size of any single
> object*.  On a '286, for example, with a 16Mb address space, size_t should
> be int, not long.

Well, no, there's no reason that it should be an int. What's important
is that it *could* be an int, and it doesn't have to be big enough to
hold a pointer.

I find it strange that the standard insisted that some integral type be
big enough for a pointer. That rule is entirely useless without a way to
figure out what the integral type is. Why did ANSI restrict the
implementor without giving the programmer anything in return?

---Dan



More information about the Comp.lang.c mailing list