avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & cowith bas


From: Jörgen Birkler
Subject: Re: [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & cowith base != {2, 8, 10, 16}?
Date: Sat, 19 Nov 2005 12:00:24 +0100

Can it be automated by the compiler?

I'm thinking something like:

inline itoa(int i,char* p,int base)
{
 if (some_magic_gcc_macro_is_constant_parameter(base))
 {
   if (base==2)
  {
     itoa_base2(i,p);
   }
   else if (base == 10)
   {
      itoa_base10(i,p);
  }
}
else {
  itoa_full(i,p);
}
}

So if you call itoa(i,p,2) it will have only link to itoa_base2.


----- Original Message ----- From: "Daniel O'Connor" <address@hidden>
To: <address@hidden>
Cc: <address@hidden>
Sent: Saturday, November 19, 2005 11:26 AM
Subject: Re: [avr-libc-dev] Re: [avr-gcc-list] Poll: Who uses itoa() & cowith base != {2, 8, 10, 16}?


_______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list






reply via email to

[Prev in Thread] Current Thread [Next in Thread]