This is the mail archive of the 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: Fix <stdint.h> bugs

On Mon, 1 Dec 2008, Ralf Corsepius wrote:

> On Mon, 2008-12-01 at 13:36 +0000, Joseph S. Myers wrote:
> > On Mon, 1 Dec 2008, Ralf Corsepius wrote:
> > 
> > > > * The limits for [u]int32_t and [u]int_least32_t were defined to "int"
> > > >   / "unsigned int" values even when newlib generally prefers "long" /
> > > >   "unsigned long" for those types when both are the same width.
> > > This is intentional, because that's what I think things should be.
> > 
> > You think that INT32_MAX should expand to a value with type "int" even 
> > when int32_t is of type long, 
> No. I am saying, INT32_MAX etc. should expand to the sizes corresponding
> to the type int32_t expands. Provided the fact there are targets for
> which int and long are not equivalent, not mixing up ints with longs
> rsp. their sizes should be the preferable approach.

The bug being fixed is only about the types of the expressions to which 
the macros expand, not about the integer values of those expressions.  
When int and long have the same size, the present header gets the types of 
the expansions of those macros wrong (but the values right).

> > See the definition of "corresponding to the type" as added in C99 TC1. 
> URL?

I think the TCs are freely downloadable from (ISO 
requires registration).  The current document with TC1, TC2 and TC3 
integrated is <>.

Joseph S. Myers

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