RTEMS patch sweep: *types.h

Paul Schlie schlie@comcast.net
Tue Feb 22 09:12:00 GMT 2005

Nice, might also be helpful to define a s/u int type and corresponding
min/max limits which is known to be the size of a pointer; which is
typically convenient to know when declaring array indexes, etc, which
although not a pointer itself, should likely be practically bounded by
the natural size of the target's potentially addressable memory. (as
unfortunately the size of an int may not be equivalent to the size of
a pointer, although typically is, but most ignore how large it may
actually be)

Thereby one can conditionally declare explicitly sized data types; and/or
a type known to be the same size of a pointer when correspondingly required.

Lastly, although not a type per-se, wonder if it might be useful to formally
specify a target defined memory_limit value, that may be utilized by code to
determine the likely type-sizes, and/or data structure sizes it may have
some flexibility in defining by default (for example, an algorithm which may
require a hash table, may define a small one, with correspondingly smaller
variable types for a target which has defined a small memory_limit, vs. a
larger one. (maybe to keep it simple, a small, medium, large enumeration
value would be sufficient)?

(sorry don't mean to complicate thing, just thought these may be helpful)

Thanks, -paul-

More information about the Newlib mailing list