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: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Ishikawa <ishikawa at yk dot rim dot or dot jp>
- Cc: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>, gcc-patches at gcc dot gnu dot org, jsm28 at cam dot ac dot uk, neil at daikokuya dot co dot uk, zack at codesourcery dot com
- Date: 21 Jul 2003 11:23:30 +0200
- Subject: Re: Support for %d$c format specifier in diagnostics.c
- Organization: Integrable Solutions
- 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><200307210419.AAA04971@caip.rutgers.edu><3F1BA8DC.A31C89BF@yk.rim.or.jp>
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