From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8847 invoked by alias); 26 Feb 2015 17:44:20 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 8838 invoked by uid 89); 26 Feb 2015 17:44:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-HELO: gproxy7-pub.mail.unifiedlayer.com Received: from gproxy7-pub.mail.unifiedlayer.com (HELO gproxy7-pub.mail.unifiedlayer.com) (70.40.196.235) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Thu, 26 Feb 2015 17:44:18 +0000 Received: (qmail 21163 invoked by uid 0); 26 Feb 2015 17:44:16 -0000 Received: from unknown (HELO cmgw2) (10.0.90.83) by gproxy7.mail.unifiedlayer.com with SMTP; 26 Feb 2015 17:44:16 -0000 Received: from box531.bluehost.com ([74.220.219.131]) by cmgw2 with id x5j41p00k2qhmhE015j7kK; Thu, 26 Feb 2015 10:43:09 -0700 X-Authority-Analysis: v=2.1 cv=bJKFfpOZ c=1 sm=1 tr=0 a=GcR8MKwCKDX7fzHfRD/fNg==:117 a=GcR8MKwCKDX7fzHfRD/fNg==:17 a=cNaOj0WVAAAA:8 a=f5113yIGAAAA:8 a=IkcTkHD0fZMA:10 a=pBbsfl06AAAA:8 a=cdVwids0oJMA:10 a=7_veK-dxs6cA:10 a=0HtSIViG9nkA:10 a=6J69WKRZNhJnGDmKYHEA:9 a=QEXdDO2ut3YA:10 Received: from [108.20.184.53] (port=54466 helo=homebase.home) by box531.bluehost.com with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.82) (envelope-from ) id 1YR2Sn-000358-5U; Thu, 26 Feb 2015 10:43:05 -0700 Message-ID: <1424972642.824.33.camel@homebase> Subject: Re: format string is not a string literal From: Paul Smith Reply-To: paul@mad-scientist.net To: Pedro Alves Cc: Jack Howarth , pinskia@gmail.com, Simon Marchi , "Paul_Koning@dell.com" , "gdb@sourceware.org" Date: Thu, 26 Feb 2015 18:34:00 -0000 In-Reply-To: <54EEECD9.4050909@redhat.com> References: <0AB56024-875B-4724-8ED2-A9DDB237CBFF@dell.com> <23CC7871-C616-436C-920C-4A635DC87189@dell.com> <7A311B56-C424-4C4F-A0E4-B12B65131745@gmail.com> <54EEECD9.4050909@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Identified-User: {678:box531.bluehost.com:madscie1:mad-scientist.us} {sentby:smtp auth 108.20.184.53 authed with paul@mad-scientist.us} X-SW-Source: 2015-02/txt/msg00070.txt.bz2 On Thu, 2015-02-26 at 09:52 +0000, Pedro Alves wrote: > + /* Use FMT from here on instead of complaint->fmt, to avoid "format > + string is not a string literal" warnings. */ > + gdb_assert (complaint->fmt == fmt); > + > if (complaint->file != NULL) > - internal_vwarning (complaint->file, complaint->line, > - complaint->fmt, args); > + internal_vwarning (complaint->file, complaint->line, fmt, args); Can someone quickly explain how using fmt instead of complaint->fmt here removes the warning? fmt is not a "string literal" either...? Just curious what the trick is...