From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id /AVKOMf53mY4OiUAWB0awg (envelope-from ) for ; Mon, 09 Sep 2024 09:36:07 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; secure) header.d=lancelotsix.com header.i=@lancelotsix.com header.a=rsa-sha256 header.s=2021 header.b=Ogdq9QKH; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D03131E353; Mon, 9 Sep 2024 09:36:07 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-11.8 required=5.0 tests=ARC_SIGNED,ARC_VALID, BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,URIBL_BLOCKED,URIBL_DBL_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 64A9E1E08F for ; Mon, 9 Sep 2024 09:36:06 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DA92E385C6C2 for ; Mon, 9 Sep 2024 13:36:05 +0000 (GMT) Received: from lndn.lancelotsix.com (lndn.lancelotsix.com [51.195.220.111]) by sourceware.org (Postfix) with ESMTPS id 453F13858D20 for ; Mon, 9 Sep 2024 13:35:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 453F13858D20 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=lancelotsix.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lancelotsix.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 453F13858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=51.195.220.111 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725888948; cv=none; b=OTpEKkKnXxU+UG/tfD1A4P4oO0w0CzQPqrCN0KhMqO/wnySaBI71pOJmUHy4dCQUXi/BJ1NR+CQweqbkPmYU4UuqayIzTAzPjTfsECmVdSW9UvKRk6RGlnbabp1zgEoUfYG+mb8Tpf5dsMw5flcu11qQHKh1xT1yZcUE7eyUiH8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725888948; c=relaxed/simple; bh=7Eijsy9RqBBzgbGYQkvIrLsRphF02V0OM0esS/9bOy0=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=H/E42N4Y+g7SI6ozlIQzhCTGBjkdwI0FnTXgb89PzpTuokfZMu1I5Jy0sCEeeC/rcvmX0mfw2NDUiyB93KQ/9gWejeWLAfPEoL9B5Pkgm7bLAcDHVctwgYpeonb6ySp8HIaxrtkBZEODyKd+FGpUq7cpSMcUe23NTdyzFTUyuQs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from octopus (unknown [IPv6:2a02:390:9086:0:788:4d61:9799:842d]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id BAB2B80CCD; Mon, 9 Sep 2024 13:35:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lancelotsix.com; s=2021; t=1725888944; bh=7Eijsy9RqBBzgbGYQkvIrLsRphF02V0OM0esS/9bOy0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ogdq9QKHlG0RMT7OrZZypLtaa+zWTzEwkXYdsXH6QmFwbehRyQkAMadbucCvezZj9 qgmONFe7eejclRywee9+Bbxv/EP6+3JbN5x1OBFejnKudscicuzjalTHDpK+tGTOYG KOb+SlUwDOpOvbdfq8a51dOPLfJDCCKTovgAlz7L+VptPBxmDK6mMBE5LRjBHtzhdu cvMAbZEuBOea2mSkqz0AZMa9ohALRZ5+RDwvYg/Ol0FO1lCxIDnRjUBmsWTyn3N+F4 Qrqx09IdLCivGxhjmtpfaOHQsZ7XS3Z1qv4U1dm50TtrenJFFB56oWbQaPzRrza5dE 4CPHdYmtgd4cw== Date: Mon, 9 Sep 2024 14:35:38 +0100 From: Lancelot SIX To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] [gdb/build] Fix unused var in corelow.c Message-ID: References: <20240909041913.929-1-tdevries@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240909041913.929-1-tdevries@suse.de> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (lndn.lancelotsix.com [0.0.0.0]); Mon, 09 Sep 2024 13:35:44 +0000 (UTC) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Hi, FYI, I see the same issue on a CI system. FWIW, the patch looks good to me. Reviewed-By: Lancelot Six Best, Lancelot. On Mon, Sep 09, 2024 at 06:19:13AM +0200, Tom de Vries wrote: > On x86_64-linux, with gcc 7.5.0 and CFLAGS/CXXFLAGS="-O0 -g -Wall" I ran into > a build breaker: > ... > gdb/corelow.c: In member function ‘void mapped_file_info::add(const char*, const char*, const char*, std::vector&&, const bfd_build_id*)’: > gdb/corelow.c:1822:27: error: unused variable ‘it’ [-Werror=unused-variable] > const auto [it, inserted] > ^ > ... > > Fix this by dropping the variable it. > > Tested on x86_64-linux. > --- > gdb/corelow.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/gdb/corelow.c b/gdb/corelow.c > index 16f07c23faa..ab2fa746de8 100644 > --- a/gdb/corelow.c > +++ b/gdb/corelow.c > @@ -1819,8 +1819,8 @@ mapped_file_info::add (const char *soname, > parsed, we group the build-id information based on the file name. As > a consequence, we should see each EXPECTED_FILENAME value exactly > once. This means that each insertion should always succeed. */ > - const auto [it, inserted] > - = m_filename_to_build_id_map.emplace (expected_filename, build_id); > + const auto inserted > + = m_filename_to_build_id_map.emplace (expected_filename, build_id).second; > gdb_assert (inserted); > > /* Setup the reverse build-id to file name map. */ > > base-commit: 29c70787112e01cd52b53bf14bdcacb0a11e0725 > -- > 2.35.3 >