From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4817 invoked by alias); 4 Mar 2010 18:21:47 -0000 Received: (qmail 4805 invoked by uid 22791); 4 Mar 2010 18:21:46 -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 18:21:41 +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 o24ILQ7Q001864 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 4 Mar 2010 13:21:26 -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 o24ILQ9p011220; Thu, 4 Mar 2010 13:21:26 -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 o24ILPBl016011; Thu, 4 Mar 2010 13:21:25 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id AD96A379963; Thu, 4 Mar 2010 11:21:24 -0700 (MST) From: Tom Tromey To: Doug Evans Cc: Pedro Alves , gdb-patches@sourceware.org Subject: Re: FYI: fix PR 11345 References: <201003040047.17716.pedro@codesourcery.com> <201003041720.47722.pedro@codesourcery.com> Reply-To: Tom Tromey Date: Thu, 04 Mar 2010 18:21:00 -0000 In-Reply-To: (Doug Evans's message of "Thu, 4 Mar 2010 09:28:39 -0800") 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/msg00203.txt.bz2 >>>>> "Doug" == Doug Evans writes: Doug> I was explicitly turning on the warning. On irc, Doug clarified that this was -Wformat=2. Doug> If we adopt the rule that this file can't be compiled with that Doug> warning, that's different. Yeah, this file can't be compiled with -Wformat-nonliteral or anything that implies it, like -Wformat=2. I am checking in the appended to the trunk and the 7.1 branch. Pedro verified that it works for him, and I also verified it locally by passing -Wformat-security explicitly. Tom 2010-03-04 Tom Tromey * printcmd.c (printf_command): Pass dummy argument to printf_filtered. Index: printcmd.c =================================================================== RCS file: /cvs/src/src/gdb/printcmd.c,v retrieving revision 1.171 diff -u -r1.171 printcmd.c --- printcmd.c 3 Mar 2010 18:05:04 -0000 1.171 +++ printcmd.c 4 Mar 2010 18:16:15 -0000 @@ -2645,8 +2645,10 @@ /* Print the portion of the format string after the last argument. Note that this will not include any ordinary %-specs, but it might include "%%". That is why we use printf_filtered and not - puts_filtered here. */ - printf_filtered (last_arg); + puts_filtered here. Also, we pass a dummy argument because + some platforms have modified GCC to include -Wformat-security + by default, which will warn here if there is no argument. */ + printf_filtered (last_arg, 0); } do_cleanups (old_cleanups); }