This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Add fast<N>_t types to stdint.h


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]