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 linux dot ucla dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 31 Aug 2008 16:28:37 +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> <Pine.LNX.4.64.0709132237100.17895@digraph.polyomino.org.uk> <20080814190920.GS22846@linux.ucla.edu>
On Thu, 14 Aug 2008, Dan Hipschman wrote:
> Index: gcc/testsuite/gcc.dg/format/unnamed-1.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/format/unnamed-1.c (revision 138884)
> +++ gcc/testsuite/gcc.dg/format/unnamed-1.c (working copy)
> @@ -19,6 +19,7 @@
> f (TItype x)
> {
> printf("%d", x); /* { dg-warning "expects type" } */
> + /* { dg-message ": ld, li$" "format suggestion" 21 } */
For 64-bit systems supporting TImode, such a suggestion would be
incorrect; there would be no correct formats to suggest for TItype.
I think you may need a new effective-target that uses the test for TImode
support found in this and other tests, so that this dg-message can be made
conditional on not having TImode support. (In general the patch should
probably be tested on both 32-bit and 64-bit systems.)
--
Joseph S. Myers
joseph@codesourcery.com