Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: tromey@redhat.com
Cc: gdb-patches@sourceware.org
Subject: Re: FYI: fix PR 11345
Date: Thu, 04 Mar 2010 17:20:00 -0000	[thread overview]
Message-ID: <201003041720.47722.pedro@codesourcery.com> (raw)
In-Reply-To: <m38wa82f9m.fsf@fleche.redhat.com>

On Thursday 04 March 2010 17:00:37, Tom Tromey wrote:
> >>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:
> 
> Pedro> gcc -g3 -O0   -I. -I../../src/gdb -I../../src/gdb/common -I../../src/gdb/config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I../../src/gdb/../include/opcode -I../../src/gdb/../readline/.. -I../bfd -I../../src/gdb/../bfd -I../../src/gdb/../include -I../libdecnumber -I../../src/gdb/../libdecnumber  -I../../src/gdb/gnulib -Ignulib  -DMI_OUT=1 -DTUI=1   `echo " -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-pointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts " | sed "s/ -Wformat-nonliteral / /g"` \
> Pedro>                 -Werror -c -o printcmd.o -MT printcmd.o -MMD -MP -MF .deps/printcmd.Tpo ../../src/gdb/printcmd.c
> Pedro> cc1: warnings being treated as errors
> Pedro> ../../src/gdb/printcmd.c: In function 'printf_command':
> Pedro> ../../src/gdb/printcmd.c:2649: error: format not a string literal and no format arguments
> 
> BTW, what version of gcc is this?  I couldn't reproduce it.

kubuntu 9.10
Target: x86_64-linux-gnu
gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9)

> 
> My gcc (F11 system) doesn't warn, and svn trunk gcc has:
> 
> 	  if (params == 0 && warn_format_security)
> 	    warning (OPT_Wformat_security,
> 		     "format not a string literal and no format arguments");
> 	  else if (params == 0 && warn_format_nonliteral)
> 	    warning (OPT_Wformat_nonliteral,
> 		     "format not a string literal and no format arguments");
> 

Ah.  It's probably an ubuntu local gcc change.

> We explicitly don't pass -Wformat-nonliteral for this file, and I don't
> see -Wformat-security in there...

Eh, I didn't realize that -Wformat-nonliteral should be of
for this file.  I now see the sneaky sed above.  That changes
perpective.

> 
> Could you try Doug's suggestion?
> 
>     printf_filtered (last_arg, 0);
> 
> If that doesn't work I will write a loop using strstr.

It works for me, indeed.  But didn't Doug say it didn't
for him?

On Thursday 04 March 2010 02:56:39, Doug Evans wrote:
> ... but having tried it I'm seeing "... argument types not checked".
> Blech.

-- 
Pedro Alves


  reply	other threads:[~2010-03-04 17:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-03 18:04 Tom Tromey
2010-03-03 18:22 ` Tom Tromey
2010-03-04  0:47 ` Pedro Alves
2010-03-04  2:35   ` Doug Evans
2010-03-04  2:43     ` Pedro Alves
2010-03-04  2:56       ` Doug Evans
2010-03-04  3:01         ` Pedro Alves
2010-03-04  2:36   ` Tom Tromey
2010-03-04 17:01   ` Tom Tromey
2010-03-04 17:20     ` Pedro Alves [this message]
2010-03-04 17:28       ` Doug Evans
2010-03-04 18:21         ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201003041720.47722.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox