From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 524FF3858D39 for ; Wed, 8 Feb 2023 17:09:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 524FF3858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from r6.localdomain (82-217-174-174.cable.dynamic.v4.ziggo.nl [82.217.174.174]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 3E68630067CA; Wed, 8 Feb 2023 18:09:36 +0100 (CET) Received: by r6.localdomain (Postfix, from userid 1000) id BCBF23402C4; Wed, 8 Feb 2023 18:09:35 +0100 (CET) Message-ID: <28359c4b9fd5d93eff021bb06533f0fe81e6f8df.camel@klomp.org> Subject: Re: [PATCH RFC 05/11] readelf: Fix set but not used variable From: Mark Wielaard To: Ilya Leoshkevich , elfutils-devel@sourceware.org Date: Wed, 08 Feb 2023 18:09:35 +0100 In-Reply-To: <20230206222513.1773039-6-iii@linux.ibm.com> References: <20230206222513.1773039-1-iii@linux.ibm.com> <20230206222513.1773039-6-iii@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.3 (3.46.3-1.fc37) MIME-Version: 1.0 X-Spam-Status: No, score=-3036.3 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_NONE,SPF_PASS,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 List-Id: Hi Ilya, On Mon, 2023-02-06 at 23:25 +0100, Ilya Leoshkevich via Elfutils-devel wrote: > clang complains: >=20 > readelf.c:10250:10: error: variable 'nculist' set but not used [-Werr= or,-Wunused-but-set-variable] > size_t nculist =3D 0; > ^ >=20 > Fix by deleting it. yeah, this is clearly a copy/paste from print_debug_macinfo_section into print_debug_macro_section where the nculist isn't actually used. Not much to add, so pushed as is. Thanks, Mark >=20 > Signed-off-by: Ilya Leoshkevich > --- > src/readelf.c | 2 -- > 1 file changed, 2 deletions(-) >=20 > diff --git a/src/readelf.c b/src/readelf.c > index f09c5c9b..76ca65f5 100644 > --- a/src/readelf.c > +++ b/src/readelf.c > @@ -10247,7 +10247,6 @@ print_debug_macro_section (Dwfl_Module *dwflmod _= _attribute__ ((unused)), > Dwarf_Off ncu =3D 0; > size_t hsize; > struct mac_culist *culist =3D NULL; > - size_t nculist =3D 0; > while (dwarf_nextcu (dbg, offset =3D ncu, &ncu, &hsize, NULL, NULL, NU= LL) =3D=3D 0) > { > Dwarf_Die cudie; > @@ -10268,7 +10267,6 @@ print_debug_macro_section (Dwfl_Module *dwflmod _= _attribute__ ((unused)), > newp->files =3D NULL; > newp->next =3D culist; > culist =3D newp; > - ++nculist; > } > =20 > const unsigned char *readp =3D (const unsigned char *) data->d_buf;