This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to fix diagnostic format warnings in cp/ dir
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 01 Jul 2003 18:21:06 +0200
- Subject: Re: Patch to fix diagnostic format warnings in cp/ dir
- Organization: Integrable Solutions
- References: <200306301555.LAA04174@caip.rutgers.edu>
"Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> writes:
| This patch zaps the diagnostic format warnings in the cp/ directory.
| Some of the warnings are bugs from extra or missing parameters.
|
| However the cp_*_at functions do something quite evil IMO. They allow
| something like this:
|
| > cp_error_at ("no specifiers", extra_arg);
|
| I.e. they allow an extra trailing argument and the line number
| location info is sucked out of the extra argument. This is
| incompatible with GCC's kind of format checking. So in those few
| cases I added an explicit specifier to consume the argument containing
| the line number info. This will cause the message to be slightly more
| verbose, but IMHO that's just fine.
the fix is to supply the location info directly, i.e.:
cp_error ("%Hno specifiers", &DECL_SOURCE_LOCATION (extra_arg));
-- Gaby