[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Re: sprintf
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] Re: sprintf |
Date: |
Tue, 3 Mar 2009 08:09:32 +0100 (MET) |
David Brown <address@hidden> wrote:
> and
> memset((A_String + 16), 0, 1);
>
> has the same effect as :
>
> A_String[16] = 0x00;
> delay_about_30_processor_cycles();
> waste_about_80_bytes_of_code_space();
Only if you're using -ffreestanding (e.g., in order to get GCC to
accept a return type "void" for main()).
If you're using -fhosted (the default), and optimize, it will
simply result in
A_String[16] = 0;
because the compiler is allowed to use internal library knowledge
in hosted mode.
(The compiler would even be allowed to optimize the sprintf() case,
but by now, it doesn't do that.)
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)
- Re: [avr-gcc-list] Re: sprintf, David VanHorn, 2009/03/02
- Re: [avr-gcc-list] Re: sprintf,
Joerg Wunsch <=
- Re: [avr-gcc-list] Re: sprintf, Joerg Wunsch, 2009/03/03
- [avr-gcc-list] Re: sprintf, David Brown, 2009/03/03
- Re: [avr-gcc-list] Re: sprintf, Pertti Kellomäki, 2009/03/03
- Re: [avr-gcc-list] Re: sprintf, Georg-Johann Lay, 2009/03/03
- Re: [avr-gcc-list] Re: sprintf, Joerg Wunsch, 2009/03/05
- [avr-gcc-list] Re: sprintf, David Brown, 2009/03/05
- Re: [avr-gcc-list] Re: sprintf, Joerg Wunsch, 2009/03/06
- [avr-gcc-list] Re: sprintf, David Brown, 2009/03/06