Patch to fix diagnostic format warnings in cp/ dir
Gabriel Dos Reis
gdr@integrable-solutions.net
Tue Jul 1 16:25:00 GMT 2003
"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
More information about the Gcc-patches
mailing list