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

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

Re: [avr-gcc-list] Re: sprintf


From: David Kelly
Subject: Re: [avr-gcc-list] Re: sprintf
Date: Fri, 27 Feb 2009 16:30:50 -0600
User-agent: Mutt/1.4.2.3i

On Fri, Feb 27, 2009 at 10:37:30PM +0100, Vincent Trouilliez wrote:
> On Fri, 27 Feb 2009 22:10:16 +0100
> David Brown <address@hidden> wrote:
> 
> >     sprintf((A_String + i), "%c", 0xff)
> > 
> > has exactly the same effect as:
> > 
> >     A_String[i] = 0xff;
> >     A_String[i + 1] = 0x00;
> >     delay_about_1000_processor_cycles();
> >     waste_about_2000_bytes_of_code_space();
> 
> ROTF ! :-))))

sprintf() only costs 2kB? Sure enough, this little program is 2132 bytes
after strip:

#include <stdio.h>

main()
{
        char tmp[100];

        sprintf( tmp, "%d", 10 );
}

-- 
David Kelly N4HHE, address@hidden
========================================================================
Whom computers would destroy, they must first drive mad.




reply via email to

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