[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] avr-gcc printf optimisation ?
From: |
Colin D Bennett |
Subject: |
Re: [avr-gcc-list] avr-gcc printf optimisation ? |
Date: |
Tue, 16 Dec 2008 22:50:39 -0800 |
On Wed, 17 Dec 2008 07:58:57 +0200
"Anton James Erasmus" <address@hidden> wrote:
> Hi,
>
> I have been using my own printf in stead of the printf of
> avr-libc. It is based on some public domain code, which was
> modified to handle the format string in flash. Since it has
> been working fine, I have not switched to the avr-libc
> version. I am not sure when this optimisation actually
> appeared in gcc, since I seldom use printf("Some
> text\r\n").
> I can rename the function, but if one uses printf, then gcc
> warns one when the parameters does not match the format
> string.
You can get gcc to check printf-type format strings for other functions
using '__attribute__((format(printf, i, j)))' in the declaration. For
example, the following declares another printf-type function that gcc
will check parameters for:
int my_printf(const char *fmt, ...)
__attribute__ ((format (printf, 1, 2)));
Regards,
Colin
signature.asc
Description: PGP signature
- [avr-gcc-list] define const char, Wynand Weyers, 2008/12/15
- RE: [avr-gcc-list] define const char, Schwichtenberg, Knut, 2008/12/15
- [avr-gcc-list] avr-gcc printf optimisation ?, Anton Erasmus, 2008/12/16
- RE: [avr-gcc-list] avr-gcc printf optimisation ?, Weddington, Eric, 2008/12/16
- RE: [avr-gcc-list] avr-gcc printf optimisation ?, Weddington, Eric, 2008/12/16
- Re: [avr-gcc-list] avr-gcc printf optimisation ?, Anton James Erasmus, 2008/12/17
- Re: [avr-gcc-list] avr-gcc printf optimisation ?,
Colin D Bennett <=
- Re: [avr-gcc-list] avr-gcc printf optimisation ?, Joerg Wunsch, 2008/12/17
- Re: [avr-gcc-list] avr-gcc printf optimisation ?, Pink Boy, 2008/12/17
- RE: [avr-gcc-list] avr-gcc printf optimisation ?, Weddington, Eric, 2008/12/17
Re: [avr-gcc-list] avr-gcc printf optimisation ?, Joerg Wunsch, 2008/12/17