This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Support for %d$c format specifier in diagnostics.c
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: ishikawa at yk dot rim dot or dot jp
- Cc: gcc-patches at gcc dot gnu dot org, gdr at integrable-solutions dot net, jsm28 at cam dot ac dot uk, neil at daikokuya dot co dot uk, zack at codesourcery dot com
- Date: Mon, 21 Jul 2003 00:19:44 -0400 (EDT)
- Subject: Re: Support for %d$c format specifier in diagnostics.c
- References: <m19WKhW-000H3mC@standard.erephon> <20030628193135.GA1767@daikokuya.co.uk> <87llvlk3gi.fsf@egil.codesourcery.com> <3EFE65DC.52576EC7@yk.rim.or.jp> <87vfupiglu.fsf@egil.codesourcery.com> <3EFEE0EF.C560ED1A@yk.rim.or.jp> <87isqoiwng.fsf@egil.codesourcery.com> <3F061172.814BA7A0@yk.rim.or.jp> <Pine.LNX.4.56.0307051127540.6302@kern.srcf.societies.cam.ac.uk> <3F0CA938.1FA02D3E@yk.rim.or.jp> <m3vfuayizy.fsf@uniton.integrable-solutions.net> <3F1A1654.4476090C@yk.rim.or.jp> <200307200451.AAA02944@caip.rutgers.edu> <3F1A4B29.B1A5363F@yk.rim.or.jp>
> From: Ishikawa <ishikawa@yk.rim.or.jp>
>
> "Kaveh R. Ghazi" wrote:
> >
> > > This is the second cut for the patch to support positional format
> > > specifier for diagnostic messege print routines.
> > >
> > > Comments/feedback welcome.
> >
> > Have you considered format checking for this new capability?
> >
>
> Nope. I must have missed the discussion.
> Could you kindly point me to an appropriate posting
> in newsgroups/mailing list archives?
On the mainline (3.4 prerelease) CVS I've added special attributes
which check the validity of format specifiers and their arguments for
functions within GCC's diagnositic framework. GCC will complain if
you make a mistake like this:
pedwarn ("blah blah %d");
because you omitted the integer argument. This is just like what GCC
does for printf via -Wformat.
For the particular patches, see:
http://gcc.gnu.org/ml/gcc-patches/2003-06/msg02515.html
http://gcc.gnu.org/ml/gcc-patches/2003-07/msg00366.html
It sounds like what you are doing will extend the set of valid format
specifiers and if so, we need to update the format checking so we
don't get spurious warnings when you new specifiers are used.
--Kaveh
PS: you should be doing your work against the main CVS trunk, not the
3.3 branch because if your work is accepted it can only go in the
mainline. The 3.3 branch is reserved for regressions fixes, no
functional additions can be accepted there.
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu