From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25937 invoked by alias); 4 Mar 2010 17:20:56 -0000 Received: (qmail 25923 invoked by uid 22791); 4 Mar 2010 17:20:55 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Mar 2010 17:20:51 +0000 Received: (qmail 11953 invoked from network); 4 Mar 2010 17:20:49 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 4 Mar 2010 17:20:49 -0000 From: Pedro Alves To: tromey@redhat.com Subject: Re: FYI: fix PR 11345 Date: Thu, 04 Mar 2010 17:20:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-19-generic; KDE/4.3.2; x86_64; ; ) Cc: gdb-patches@sourceware.org References: <201003040047.17716.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201003041720.47722.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00192.txt.bz2 On Thursday 04 March 2010 17:00:37, Tom Tromey wrote: > >>>>> "Pedro" == Pedro Alves 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