This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Add format string suggestions to -Wformat warnings
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Dan Hipschman <dsh at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 13 Sep 2007 22:44:08 +0000 (UTC)
- Subject: Re: PATCH: Add format string suggestions to -Wformat warnings
- References: <20070814235109.GD11055@google.com> <Pine.LNX.4.64.0708150022000.22971@digraph.polyomino.org.uk> <20070821222124.GE11055@google.com>
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