From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17983 invoked by alias); 14 Oct 2019 00:00:25 -0000 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 Received: (qmail 17917 invoked by uid 89); 14 Oct 2019 00:00:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1264, silence X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Oct 2019 00:00:18 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id x9E00Big019799 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 13 Oct 2019 20:00:16 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca x9E00Big019799 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1571011216; bh=QCstn98OL5VZenUjppUH1iR1OoXsYDpxAfmnvGEDz9M=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nUC01+72Ev4VTtc+ghO5AnsGwEpFyt20sZTHFEQxnjeNyRMKH3YF5hH6eVRdpHyhD 0XdFQsuTE+tjTtKTXtgw0jN3qBLXSIMhzQyv9hkCJEWAg0NWcUHJJznoVKOKK9C0+V jx8UT3W1ltmeNCqpn/09/hTE3SBfcTbTa9aHUX/0= Received: by simark.ca (Postfix, from userid 112) id D33731E8E4; Sun, 13 Oct 2019 20:00:10 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id C63F91E4C2; Sun, 13 Oct 2019 20:00:07 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 14 Oct 2019 00:00:00 -0000 From: Simon Marchi To: Kevin Buettner Cc: gdb-patches@sourceware.org, Simon Marchi Subject: Re: [PATCH] gdb: Silence -Wformat-nonliteral warning with clang In-Reply-To: <20191013111714.4a46dbdb@f29-4.lan> References: <20191011205426.1859-1-simon.marchi@efficios.com> <20191013111714.4a46dbdb@f29-4.lan> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.10 X-IsSubscribed: yes X-SW-Source: 2019-10/txt/msg00326.txt.bz2 On 2019-10-13 14:17, Kevin Buettner wrote: > On Fri, 11 Oct 2019 16:54:26 -0400 > Simon Marchi wrote: > >> We get this warning when building with clang: >> >> CXX ui-out.o >> /home/smarchi/src/binutils-gdb/gdb/ui-out.c:590:22: error: format >> string is not a string literal [-Werror,-Wformat-nonliteral] >> do_message (style, format, args); >> ^~~~~~ >> >> This can be considered a legitimate warning, as call_do_message's >> format >> parameter is not marked as a format string. Therefore, we should >> normally mark the call_do_message method with the `format` attribute. >> However, doing so just moves (and multiplies) the problem, as all the >> uses of call_do_message in the vmessage method now warn. If we wanted >> to continue on that path, we should silence the warning for each of >> them, as a way of telling the compiler "it's ok, we know what we are >> doing". >> >> But since call_do_message is really just vmessage's little helper, >> it's >> simpler to just silence the warning at that single point. >> >> gdb/ChangeLog: >> >> * ui-out.c (ui_out::call_do_message): Silence >> -Wformat-nonliteral warning. > > LGTM. > > Kevin Thanks, I pushed it. Simon