PATCH: Add format string suggestions to -Wformat warnings

Joseph S. Myers joseph@codesourcery.com
Thu Sep 13 23:20:00 GMT 2007


On Tue, 21 Aug 2007, Dan Hipschman wrote:

> > dg-excess-errors should only be used very sparingly with xfail.  When 
> > there are specific diagnostics expected on specific lines, you should 
> > update the tests to match each new diagnostic individually rather than 
> > using dg-excess-errors to match them all together.
> 
> OK, I've done this, too.

We're moving away from having dg-* as regular expressions to match 
multiple messages on one line to having a separate dg-* for each 
diagnostic (that way, you know if only some of the expected diagnostics on 
a line have disappeared).

Thus, rather than changing the existing dg-warning to dg-message with 
regular expressions, you should leave them alone and add new dg-message 
lines for the new diagnostics (which use line numbers to identify the line 
on which the diagnostic is expected, { dg-message "regexp" "description" { 
target *-*-* } line-number }) (the description serves to make the PASS or 
FAIL lines unique when multiple diagnostics are expected on the same line 
and would otherwise get identical PASS or FAIL lines).

The revised C front-end changes look good to me but I can't reach a final 
conclusion on them without seeing the tests revised to avoid matching 
multiple diagnostics with a single regexp.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list