[PATCH] itoa

Jon Beniston jon@beniston.com
Tue Dec 9 10:45:00 GMT 2014


Hi Corinna,

> Given that this is non-standard anyway, what about creating a safer 
> alternative instead, along the lines of Craig's/Freddie's itoa_s/np?
>
> Also, shouldn't the functions start with an underscore so as not 
> to pollute the standard namespace?  itoa and utoa are very likely 
> not uncommon as function names in existing projects.

Perhaps. I wrote it so that some existing code would compile though. In stdlib.h, it's in a #ifndef __STRICT_ANSI__ block next to dtoa() et al., which I presume are just as non-standard. 

>> I've also modified it as per Freddie's suggestion.
>
> Did you test it?  AFAICS, the itoa function never returns the sign:

Oops, not Freddie's version. Updated version attached.

Cheers,
Jon

-------------- next part --------------
A non-text attachment was scrubbed...
Name: itoa3.patch
Type: application/octet-stream
Size: 5057 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20141209/fd07a049/attachment.obj>


More information about the Newlib mailing list