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: Patch to fix diagnostic format warnings in cp/ dir


"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


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