From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 6D20E3858CDA for ; Mon, 26 Sep 2022 09:00:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6D20E3858CDA Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-267-Wc1H-1NMPCe6lMSo6IpoIw-1; Mon, 26 Sep 2022 05:00:16 -0400 X-MC-Unique: Wc1H-1NMPCe6lMSo6IpoIw-1 Received: by mail-ed1-f72.google.com with SMTP id m13-20020a056402510d00b004519332f0b1so4870289edd.7 for ; Mon, 26 Sep 2022 02:00:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=D/dNUs2jWMMlwci5jtaqCnX+toUx/+N2La8fDf5/604=; b=VcB91fEXzS/orjrwNform14qJiu7fM+yA6pXXwL3SUJfKT2a9Ac+c7NM/L5+RYFODj iBwLakUAPBtzeJt58Z9uZHGPtGm+WjCwsFFs8ftyJVkmF4LYpIPvSRZM6NlOjk7CqzS4 ypyGHIoidaSsJPMtgKv9yTBYfbZ43HnOwxVwo1XSTMPELDObde0MxIGX0rleijVidFgd yt3h8++soizMjSRQN5sPOcswt1vRyEsrvvf/JL1cLGWTfYCmoJf8VQJmQJTg5yDvCJvw dXU5Ghnx9YemU4eT4Ya155jcueXUDZEvGWTxXm8XVi/9dR0ltpfVsSKkTCFj79bnhuuC NttA== X-Gm-Message-State: ACrzQf0LiTko4HFGYlRq568leQlD60qd1AYmxXFzt1tRSJId7+oE09kH femWthb7Pase3FjLA93wRktYh7U9cbvud34E0NaEiRTuRNx3FVvlQY4lwrGxSDpQbenXyAHUFIL Vzhp0TA6g0eTadgb1mnXi3Q== X-Received: by 2002:a17:907:724a:b0:782:3754:ecb3 with SMTP id ds10-20020a170907724a00b007823754ecb3mr17592799ejc.282.1664182814924; Mon, 26 Sep 2022 02:00:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Fd+y5r/cbTGYNVb6PFMO3tZE1QnsIibe8AxwLY5XkOln/scK1rS79LNCIXT7BJO9uqpkhoQ== X-Received: by 2002:a17:907:724a:b0:782:3754:ecb3 with SMTP id ds10-20020a170907724a00b007823754ecb3mr17592782ejc.282.1664182814711; Mon, 26 Sep 2022 02:00:14 -0700 (PDT) Received: from [192.168.0.45] (ip-213-220-232-121.bb.vodafone.cz. [213.220.232.121]) by smtp.gmail.com with ESMTPSA id ku8-20020a170907788800b0073d81b0882asm8003379ejc.7.2022.09.26.02.00.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Sep 2022 02:00:14 -0700 (PDT) Message-ID: Date: Mon, 26 Sep 2022 11:00:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH] gdb: Remove unused extra_lines variable To: Tsukasa OI Cc: gdb-patches@sourceware.org References: <3090ae2157c8eae596b1bf5989c1853b865fdacf.1664093762.git.research_trasio@irq.a4lg.com> From: Bruno Larsen In-Reply-To: <3090ae2157c8eae596b1bf5989c1853b865fdacf.1664093762.git.research_trasio@irq.a4lg.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2022 09:00:21 -0000 On 25/09/2022 10:17, Tsukasa OI via Gdb-patches wrote: > Clang generates a warning if there is a variable that is set but not used > otherwise ("-Wunused-but-set-variable"). On the default configuration, it > causes a build failure (unless "--disable-werror" is specified). > > The only extra_lines use in arrange_linetable function is removed on the > commit 558802e4d1c5dcbd0df7d2c6ef62a6deac247a2f > ("gdb: change subfile::line_vector to an std::vector"). So, this variable > should be removed to prevent a build failure. Hi Tsukasa! This patch looks pretty safe. The point at which extra_lines would be used has the exact same check used to set it, instead of using the variable, so I think there is no need for it after all. That said, I can't approve the patch for pushing, so I hope a maintainer looks at this soon. > > gdb/ChangeLog: > > * xcoffread.c (arrange_linetable): Remove unused extra_lines. side note, GDB doesn't require changelogs anymore, but there are no rules against it, so you can leave it here if you'd like. Cheers, Bruno > --- > gdb/xcoffread.c | 8 -------- > 1 file changed, 8 deletions(-) > > diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c > index b7d65771115..aa88cbc724d 100644 > --- a/gdb/xcoffread.c > +++ b/gdb/xcoffread.c > @@ -419,8 +419,6 @@ add_stab_to_list (char *stabname, struct pending_stabs **stabvector) > static void > arrange_linetable (std::vector &old_linetable) > { > - int extra_lines = 0; > - > std::vector fentries; > > for (int ii = 0; ii < old_linetable.size (); ++ii) > @@ -436,12 +434,6 @@ arrange_linetable (std::vector &old_linetable) > e.line = ii; > e.is_stmt = 1; > e.pc = old_linetable[ii].pc; > - > - /* If the function was compiled with XLC, we may have to add an > - extra line entry later. Reserve space for that. */ > - if (ii + 1 < old_linetable.size () > - && old_linetable[ii].pc != old_linetable[ii + 1].pc) > - extra_lines++; > } > } > > > base-commit: 58d69206b8173b9d027a6c65f56cdaf045ae6e64