[PATCH] unify itoa

Rich Felker dalias at aerifal.cx
Sat Jul 8 22:12:03 PDT 2006


On Sat, Jul 08, 2006 at 09:59:03PM +0200, Denis Vlasenko wrote:
> On Saturday 08 July 2006 21:40, Michael S. Zick wrote:
> > > It calculates maximum power-of-10 which fits in unsigned int.
> > > It does that at compile time, portably. That's why it looks funny.
> > > 
> > > gcc optimizes it out to simple 1000000000 constant
> > > (if sizeof(unsigned)==4, that is).
> > 
> > Unless you are supporting multiple brands of compilers, it
> > optimizes out to a simple constant before you write the code.
> 
> The whole world is not a x86[-64].
> 
> Please show me the simple constant which is a biggest
> power of 10 which fits into variable of type "int" on
> platforms with 16-bit, 32-bit, 64-bit and 128-bit ints?

There are no such things at present, only 32-bit ints.

Rich



More information about the busybox mailing list