From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2298 invoked by alias); 4 Mar 2010 17:01:00 -0000 Received: (qmail 2290 invoked by uid 22791); 4 Mar 2010 17:01:00 -0000 X-SWARE-Spam-Status: No, hits=-7.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Mar 2010 17:00:54 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o24H0g0h001357 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 4 Mar 2010 12:00:42 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o24H0erk019952; Thu, 4 Mar 2010 12:00:40 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o24H0cPG008290; Thu, 4 Mar 2010 12:00:39 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 58E60379963; Thu, 4 Mar 2010 10:00:38 -0700 (MST) From: Tom Tromey To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: FYI: fix PR 11345 References: <201003040047.17716.pedro@codesourcery.com> Reply-To: tromey@redhat.com Date: Thu, 04 Mar 2010 17:01:00 -0000 In-Reply-To: <201003040047.17716.pedro@codesourcery.com> (Pedro Alves's message of "Thu, 4 Mar 2010 00:47:17 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00190.txt.bz2 >>>>> "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. 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"); We explicitly don't pass -Wformat-nonliteral for this file, and I don't see -Wformat-security in there... Could you try Doug's suggestion? printf_filtered (last_arg, 0); If that doesn't work I will write a loop using strstr. Tom