From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127159 invoked by alias); 16 Jul 2018 15:11:47 -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 127148 invoked by uid 89); 16 Jul 2018 15:11:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=circumstances, expedite X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Jul 2018 15:11:46 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8F81F402243B; Mon, 16 Jul 2018 15:11:44 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14CD22156893; Mon, 16 Jul 2018 15:11:43 +0000 (UTC) Subject: Re: [RFA 12/13] Add ATTRIBUTE_UNUSED to regdat.sh output To: Tom Tromey , gdb-patches@sourceware.org References: <20180712205208.32646-1-tom@tromey.com> <20180712205208.32646-13-tom@tromey.com> From: Pedro Alves Message-ID: <9c6ed571-1f28-f527-64ff-445f51089dcd@redhat.com> Date: Mon, 16 Jul 2018 15:11:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180712205208.32646-13-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-07/txt/msg00482.txt.bz2 On 07/12/2018 09:52 PM, Tom Tromey wrote: > This changes regdat.sh to emit ATTRIBUTE_UNUSED for the > xmltarget_${name} variable. This seemed simpler than trying to figure > out under exactly which circumstances each one was in fact used. Can you give an example configuration where you got a warning? Thanks, Pedro Alves > > 2018-07-12 Tom Tromey > > * regformats/regdat.sh: Mark xmltarget_${name} with > ATTRIBUTE_UNUSED. > --- > gdb/ChangeLog | 5 +++++ > gdb/regformats/regdat.sh | 8 ++++---- > 2 files changed, 9 insertions(+), 4 deletions(-) > > diff --git a/gdb/regformats/regdat.sh b/gdb/regformats/regdat.sh > index 5a8564ac50c..7868e757582 100755 > --- a/gdb/regformats/regdat.sh > +++ b/gdb/regformats/regdat.sh > @@ -164,12 +164,12 @@ done > echo > echo "static const char *expedite_regs_${name}[] = { \"`echo ${expedite} | sed 's/,/", "/g'`\", 0 };" > if test "${feature}" != x; then > - echo "static const char *xmltarget_${name} = 0;" > + echo "static const char *xmltarget_${name} ATTRIBUTE_UNUSED = 0;" > elif test "${xmltarget}" = x; then > if test "${xmlarch}" = x && test "${xmlosabi}" = x; then > - echo "static const char *xmltarget_${name} = 0;" > + echo "static const char *xmltarget_${name} ATTRIBUTE_UNUSED = 0;" > else > - echo "static const char *xmltarget_${name} = \"@\\" > + echo "static const char *xmltarget_${name} ATTRIBUTE_UNUSED = \"@\\" > if test "${xmlarch}" != x; then > echo "${xmlarch}\\" > fi > @@ -179,7 +179,7 @@ elif test "${xmltarget}" = x; then > echo "\";" > fi > else > - echo "static const char *xmltarget_${name} = \"${xmltarget}\";" > + echo "static const char *xmltarget_${name} ATTRIBUTE_UNUSED = \"${xmltarget}\";" > fi > echo > >