public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Avoid warning for for %E format
@ 2009-04-22 13:16 Rafael Espindola
  2009-04-22 13:50 ` Joseph S. Myers
  0 siblings, 1 reply; 2+ messages in thread
From: Rafael Espindola @ 2009-04-22 13:16 UTC (permalink / raw)
  To: Gcc Patch List; +Cc: Diego Novillo

[-- Attachment #1: Type: text/plain, Size: 520 bytes --]

The patch in http://gcc.gnu.org/ml/gcc-cvs/2009-04/msg00931.html adds
support for the %E modifier, but we would still produce a warning for

 warning (0, G_("%H%qE is assigned to itself"), &location, lhs);

this patches fixes the warning.

2009-04-22  Rafael Avila de Espindola  <espindola@google.com>

	* c-format.c (gcc_tdiag_char_table): Add support for %E.

Cheers,
-- 
Rafael Avila de Espindola

Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047

[-- Attachment #2: warning.patch --]
[-- Type: text/x-patch, Size: 758 bytes --]

diff --git a/gcc/c-format.c b/gcc/c-format.c
index 24a292f..f64cb21 100644
--- a/gcc/c-format.c
+++ b/gcc/c-format.c
@@ -588,7 +588,7 @@ static const format_char_info gcc_tdiag_char_table[] =
   { "H",   0, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "q",  "",   NULL },
 
   /* These will require a "tree" at runtime.  */
-  { "DFJKT", 0, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "q+", "",   NULL },
+  { "DFJKTE", 0, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "q+", "",   NULL },
 
   { "<>'", 0, STD_C89, NOARGUMENTS, "",      "",   NULL },
   { "m",   0, STD_C89, NOARGUMENTS, "q",     "",   NULL },

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] Avoid warning for for %E format
  2009-04-22 13:16 [patch] Avoid warning for for %E format Rafael Espindola
@ 2009-04-22 13:50 ` Joseph S. Myers
  0 siblings, 0 replies; 2+ messages in thread
From: Joseph S. Myers @ 2009-04-22 13:50 UTC (permalink / raw)
  To: Rafael Espindola; +Cc: Gcc Patch List, Diego Novillo

On Wed, 22 Apr 2009, Rafael Espindola wrote:

> The patch in http://gcc.gnu.org/ml/gcc-cvs/2009-04/msg00931.html adds
> support for the %E modifier, but we would still produce a warning for
> 
>  warning (0, G_("%H%qE is assigned to itself"), &location, lhs);
> 
> this patches fixes the warning.
> 
> 2009-04-22  Rafael Avila de Espindola  <espindola@google.com>
> 
> 	* c-format.c (gcc_tdiag_char_table): Add support for %E.

How did you test this?  I'd have expected it to cause testsuite failures, 
since gcc.dg/format/gcc_diag-1.c contains:

  tdiag ("%E", t1); /* { dg-warning "format" "bogus tree" } */

OK with the dg-warning on that line removed if the resulting patch passes 
bootstrap with no regressions.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-22 13:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-22 13:16 [patch] Avoid warning for for %E format Rafael Espindola
2009-04-22 13:50 ` Joseph S. Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).