Haai,
The definition of size_t keeps biting me.
Some background: in nnx, me's been using the equiv of caddr_t for
counts. This works well; yet, while writing against existing code that
uses size_t, an issue has surfaced.
First of all, let us reflect upon the definition of size_t in C99.
> size_t
> which is the unsigned integer type of the result of the sizeof
> operator;
That's not very specific. It kind-of implies that SIZE_MAX (defined
later in the standard) is the largest possible offset, but not
necessarily the largest possible address. This reeks of i86 real mode
semantics, obsolete (for general-purpose machines) already when the
PDP-11 was new.
POSIX is even less helpful:
> size_t
> Used for sizes of objects.
(Let me note in passing that medisapproves of the significant overlap
between C99 and POSIX, and the shameless disregard, in both, of the
byte-oriented nature of UNIX and C).
So, as meknows of no better place to ask (take that as a compliment
folks!), mehas the following question *cue drums*:
Is SIZE_MAX guaranteed to *not* be greater than the highest address?
Me'd be grateful for any insight anyone can offer.
Thanks in advance,
Baai,
--zeurkous.
--
Friggin' Machines!