This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: formats and syslog question
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Marc Espie <espie at nerim dot net>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Sat, 14 Sep 2002 12:23:21 +0100 (BST)
- Subject: Re: formats and syslog question
On Sat, 14 Sep 2002, Marc Espie wrote:
> On Sat, Sep 14, 2002 at 11:45:50AM +0100, Joseph S. Myers wrote:
> > Duplication of a table and the consequent risk of divergence between the
> > two similar but different tables, both of which now need to be maintained.
>
> This can be handled easily, by not using cut&paste but programming the copy
> instead. Acceptable ?
I suggest the alternative syntax
__attribute__ ((__format__(__printf__, 2, 3, __nopedantic__)))
to disable all pedantic checking of that format applied to that function,
which has some potential of other uses. (Clearly a syslog format
shouldn't give pedantic warnings for %C or %S or the ' flag or $ formats,
as well as %m; but if treated as a separate format from printf it
shouldn't give pedantic warnings for other extensions either since it's
none of -pedantic's business to warn for features outside a standard other
than ISO C/C++. Treating syslog formats as entirely separate from the
existing four types supported implies -pedantic should not be concerned
with them any more than it is with GNU extensions to strfmon formats at
present.)
--
Joseph S. Myers
jsm28@cam.ac.uk