This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [patch] Add fast<N>_t types to stdint.h
- From: Corinna Vinschen <vinschen at redhat dot com>
- To: Newlib List <newlib at sources dot redhat dot com>
- Date: Thu, 22 Sep 2005 10:40:01 +0200
- Subject: Re: [patch] Add fast<N>_t types to stdint.h
- References: <1127360870.12649.214.camel@mccallum.corsepiu.local>
- Reply-to: newlib at sources dot redhat dot com
Hi Ralf,
On Sep 22 05:47, Ralf Corsepius wrote:
> Hi,
>
> the patch below adds fastN_t support to stdint.h
I assume this is meant as a default implementation, right?
The reason I'm asking is that this implementation defines the size
of the fast type to be the same as the type with the same width. But
that's obviously not always the fast type. On 32 bit CPUs the
int_fast16_t type is mostly 32 bit, on 64 bit CPUs it's 64 bit.
But that's the problem, the implementation of fast types requires
a bit of knowledge about the CPU.
Wouldn't it make sense to implement something like a __WORDSIZE
macro in newlib, using some new header file inside libc/machine/*,
for instance bits.h?
OTOH, maybe it's already enough to use the INT_MAX definition which
falls out of sys/config.h. The default integer type is usually
equivalent to the native word type and therefore also the fast type...
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat, Inc.