This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Support for %d$c format specifier in diagnostics.c


 > 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]