This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: RTEMS patch sweep: *types.h
- From: Ralf Corsepius <ralf dot corsepius at rtems dot org>
- To: Paul Schlie <schlie at comcast dot net>
- Cc: Newlib List <newlib at sources dot redhat dot com>
- Date: Tue, 22 Feb 2005 11:05:10 +0100
- Subject: Re: RTEMS patch sweep: *types.h
- References: <BE4061A3.92DA%schlie@comcast.net>
On Tue, 2005-02-22 at 04:12 -0500, Paul Schlie wrote:
> 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;
Do you mean intptr_t and uintptr_t?
These are to come as part of one of my next patches ;-)
> 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)?
I didn't think about this yet.
The original motivation behind these patches (and further patches to
come) was implementing a portable stdint.h and inttypes.h (Scheduled to
come soon, should these patches be accepted)
It gradually had evolved into a partial cleanup of fixed-size in RTEMS
and newlib with regard to SUSv3 and BSD :-)
Ralf