[mc1322x] "atoi" oversize

Daniel Berenguer dberenguer at usapiens.com
Fri Jul 2 16:14:00 EDT 2010


Yes, a custom atoi implementation is what I'm using to avoid the issue
for the time being. As for the CodeSourcery toolchain, I think it's
worth to give it a try.

Daniel.


On 2 July 2010 20:24, Ian Martin <martini at alum.mit.edu> wrote:
> On Fri, Jul 2, 2010 at 10:01 AM, Daniel Berenguer
> <dberenguer at usapiens.com> wrote:
>> I'm currently writing a simple contiki-based application where the use
>> of "atoi" is making the code grow from 59 KB to 487 KB !!
>
> In case you just want a quick fix:
>
> int atoi_tiny(const char* a) {
>        int i = 0;
>        for (; (*a >= '0') && (*a <= '9'); a++)
>                i = 10 * i + (*a - '0');
>        return i;
> }
>
> -Ian
>



More information about the mc1322x mailing list