This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: No printf-format checking for snprintf & friends?
- From: Jonathan Larmour <jlarmour at redhat dot com>
- To: Martin Buck <martin dot buck at ascom dot ch>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Tue, 30 Apr 2002 20:35:20 +0100
- Subject: Re: [ECOS] No printf-format checking for snprintf & friends?
- Organization: Red Hat UK Ltd.
- References: <3CC5194B.5A73B85B@ascom.ch>
Martin Buck wrote:
>
> Hi,
>
> is there any particular reason why the eCos libc doesn't enable gcc's
> printf-format checking for functions like snprintf()? AFAIK, gcc does
> this by default for ISO-C functions, but not for the non-ISO stuff, so
> stdio.h would have to specify __attribute__ ((__format ... )) for them.
> Anybody interested in a patch?
I believed that GCC automatically does it for functions called printf()
etc. I thought it was only non-standard functions that don't get the
checking. Or are you saying that GCC doesn't do this for snprintf() in
particular?
If you do add this, use a macro (and define it in cyg_type.h) for it.
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
--[ "You can complain because roses have thorns, or you ]--
--[ can rejoice because thorns have roses." -Lincoln ]-- Opinions==mine
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss