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


Ishikawa <ishikawa@yk.rim.or.jp> writes:

| > 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
| 
| I will study this and see what I can do.
| But I have a doubt if the checking of positional parameter
| is of immediate necessity due to the following observation:
| the positional construct is VERY UNLIKELY to be used
| inside the GCC source files.

What that means is simply that if we wanted to check formats augmented
with the positional thingy, then we should not check each individual
toplevel diagnostic routines; instead we should have special code to
check calls to report_diagnostic -- I'm not sure I want to head that
way.   

-- Gaby


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